@@ -145,6 +145,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
145
145
}
146
146
147
147
Opts.RelaxELFRelocations = !Args.hasArg (OPT_mrelax_relocations_no);
148
+ Opts.SSE2AVX = Args.hasArg (OPT_msse2avx);
148
149
if (auto *DwarfFormatArg = Args.getLastArg (OPT_gdwarf64, OPT_gdwarf32))
149
150
Opts.Dwarf64 = DwarfFormatArg->getOption ().matches (OPT_gdwarf64);
150
151
Opts.DwarfVersion = getLastArgIntValue (Args, OPT_dwarf_version_EQ, 2 , Diags);
@@ -234,6 +235,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
234
235
235
236
Opts.EmitCompactUnwindNonCanonical =
236
237
Args.hasArg (OPT_femit_compact_unwind_non_canonical);
238
+ Opts.Crel = Args.hasArg (OPT_crel);
237
239
238
240
Opts.AsSecureLogFile = Args.getLastArgValue (OPT_as_secure_log_file);
239
241
@@ -287,8 +289,14 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
287
289
assert (MRI && " Unable to create target register info!" );
288
290
289
291
MCTargetOptions MCOptions;
292
+ MCOptions.MCRelaxAll = Opts.RelaxAll ;
290
293
MCOptions.EmitDwarfUnwind = Opts.EmitDwarfUnwind ;
291
294
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 ;
292
300
MCOptions.AsSecureLogFile = Opts.AsSecureLogFile ;
293
301
294
302
std::unique_ptr<MCAsmInfo> MAI (
@@ -297,9 +305,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
297
305
298
306
// Ensure MCAsmInfo initialization occurs before any use, otherwise sections
299
307
// may be created with a combination of default and explicit settings.
300
- MAI->setCompressDebugSections (Opts.CompressDebugSections );
301
308
302
- MAI->setRelaxELFRelocations (Opts.RelaxELFRelocations );
303
309
304
310
bool IsBinary = Opts.OutputType == AssemblerInvocation::FT_Obj;
305
311
if (Opts.OutputPath .empty ())
@@ -343,8 +349,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
343
349
MOFI->setDarwinTargetVariantSDKVersion (Opts.DarwinTargetVariantSDKVersion );
344
350
Ctx.setObjectFileInfo (MOFI.get ());
345
351
346
- if (Opts.SaveTemporaryLabels )
347
- Ctx.setAllowTemporaryLabels (false );
348
352
if (Opts.GenDwarfForAssembly )
349
353
Ctx.setGenDwarfForAssembly (true );
350
354
if (!Opts.DwarfDebugFlags .empty ())
@@ -381,6 +385,9 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
381
385
MCOptions.MCNoWarn = Opts.NoWarn ;
382
386
MCOptions.MCFatalWarnings = Opts.FatalWarnings ;
383
387
MCOptions.MCNoTypeCheck = Opts.NoTypeCheck ;
388
+ MCOptions.ShowMCInst = Opts.ShowInst ;
389
+ MCOptions.AsmVerbose = true ;
390
+ MCOptions.MCUseDwarfDirectory = MCTargetOptions::EnableDwarfDirectory;
384
391
MCOptions.ABIName = Opts.TargetABI ;
385
392
386
393
// FIXME: There is a bit of code duplication with addPassesToEmitFile.
@@ -395,10 +402,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
395
402
TheTarget->createMCAsmBackend (*STI, *MRI, MCOptions));
396
403
397
404
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)));
402
407
} else if (Opts.OutputType == AssemblerInvocation::FT_Null) {
403
408
Str.reset (createNullStreamer (Ctx));
404
409
} else {
@@ -421,9 +426,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
421
426
422
427
Triple T (Opts.Triple );
423
428
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));
427
430
Str.get ()->initSections (Opts.NoExecStack , *STI);
428
431
}
429
432
@@ -436,9 +439,6 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
436
439
Str.get ()->emitZeros (1 );
437
440
}
438
441
439
- // Assembly to object compilation should leverage assembly info.
440
- Str->setUseAssemblerInfoForParsing (true );
441
-
442
442
bool Failed = false ;
443
443
444
444
std::unique_ptr<MCAsmParser> Parser (
0 commit comments