@@ -145,6 +145,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
145145 }
146146
147147 Opts.RelaxELFRelocations = !Args.hasArg (OPT_mrelax_relocations_no);
148+ Opts.SSE2AVX = Args.hasArg (OPT_msse2avx);
148149 if (auto *DwarfFormatArg = Args.getLastArg (OPT_gdwarf64, OPT_gdwarf32))
149150 Opts.Dwarf64 = DwarfFormatArg->getOption ().matches (OPT_gdwarf64);
150151 Opts.DwarfVersion = getLastArgIntValue (Args, OPT_dwarf_version_EQ, 2 , Diags);
@@ -234,6 +235,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
234235
235236 Opts.EmitCompactUnwindNonCanonical =
236237 Args.hasArg (OPT_femit_compact_unwind_non_canonical);
238+ Opts.Crel = Args.hasArg (OPT_crel);
237239
238240 Opts.AsSecureLogFile = Args.getLastArgValue (OPT_as_secure_log_file);
239241
@@ -287,8 +289,14 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
287289 assert (MRI && " Unable to create target register info!" );
288290
289291 MCTargetOptions MCOptions;
292+ MCOptions.MCRelaxAll = Opts.RelaxAll ;
290293 MCOptions.EmitDwarfUnwind = Opts.EmitDwarfUnwind ;
291294 MCOptions.EmitCompactUnwindNonCanonical = Opts.EmitCompactUnwindNonCanonical ;
295+ MCOptions.MCSaveTempLabels = Opts.SaveTemporaryLabels ;
296+ MCOptions.Crel = Opts.Crel ;
297+ MCOptions.X86RelaxRelocations = Opts.RelaxELFRelocations ;
298+ MCOptions.X86Sse2Avx = Opts.SSE2AVX ;
299+ MCOptions.CompressDebugSections = Opts.CompressDebugSections ;
292300 MCOptions.AsSecureLogFile = Opts.AsSecureLogFile ;
293301
294302 std::unique_ptr<MCAsmInfo> MAI (
@@ -297,9 +305,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
297305
298306 // Ensure MCAsmInfo initialization occurs before any use, otherwise sections
299307 // may be created with a combination of default and explicit settings.
300- MAI->setCompressDebugSections (Opts.CompressDebugSections );
301308
302- MAI->setRelaxELFRelocations (Opts.RelaxELFRelocations );
303309
304310 bool IsBinary = Opts.OutputType == AssemblerInvocation::FT_Obj;
305311 if (Opts.OutputPath .empty ())
@@ -343,8 +349,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
343349 MOFI->setDarwinTargetVariantSDKVersion (Opts.DarwinTargetVariantSDKVersion );
344350 Ctx.setObjectFileInfo (MOFI.get ());
345351
346- if (Opts.SaveTemporaryLabels )
347- Ctx.setAllowTemporaryLabels (false );
348352 if (Opts.GenDwarfForAssembly )
349353 Ctx.setGenDwarfForAssembly (true );
350354 if (!Opts.DwarfDebugFlags .empty ())
@@ -381,6 +385,9 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
381385 MCOptions.MCNoWarn = Opts.NoWarn ;
382386 MCOptions.MCFatalWarnings = Opts.FatalWarnings ;
383387 MCOptions.MCNoTypeCheck = Opts.NoTypeCheck ;
388+ MCOptions.ShowMCInst = Opts.ShowInst ;
389+ MCOptions.AsmVerbose = true ;
390+ MCOptions.MCUseDwarfDirectory = MCTargetOptions::EnableDwarfDirectory;
384391 MCOptions.ABIName = Opts.TargetABI ;
385392
386393 // FIXME: There is a bit of code duplication with addPassesToEmitFile.
@@ -395,10 +402,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
395402 TheTarget->createMCAsmBackend (*STI, *MRI, MCOptions));
396403
397404 auto FOut = std::make_unique<formatted_raw_ostream>(*Out);
398- Str.reset (TheTarget->createAsmStreamer (
399- Ctx, std::move (FOut), /* asmverbose*/ true ,
400- /* useDwarfDirectory*/ true , IP, std::move (CE), std::move (MAB),
401- Opts.ShowInst ));
405+ Str.reset (TheTarget->createAsmStreamer (Ctx, std::move (FOut), IP,
406+ std::move (CE), std::move (MAB)));
402407 } else if (Opts.OutputType == AssemblerInvocation::FT_Null) {
403408 Str.reset (createNullStreamer (Ctx));
404409 } else {
@@ -421,9 +426,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
421426
422427 Triple T (Opts.Triple );
423428 Str.reset (TheTarget->createMCObjectStreamer (
424- T, Ctx, std::move (MAB), std::move (OW), std::move (CE), *STI,
425- Opts.RelaxAll , Opts.IncrementalLinkerCompatible ,
426- /* DWARFMustBeAtTheEnd*/ true ));
429+ T, Ctx, std::move (MAB), std::move (OW), std::move (CE), *STI));
427430 Str.get ()->initSections (Opts.NoExecStack , *STI);
428431 }
429432
@@ -436,9 +439,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
436439 Str.get ()->emitZeros (1 );
437440 }
438441
439- // Assembly to object compilation should leverage assembly info.
440- Str->setUseAssemblerInfoForParsing (true );
441-
442442 bool Failed = false ;
443443
444444 std::unique_ptr<MCAsmParser> Parser (
0 commit comments