]> granicus.if.org Git - clang/commitdiff
Fill in the options in the MCOptions struct directly like the other
authorEric Christopher <echristo@gmail.com>
Thu, 15 May 2014 01:21:56 +0000 (01:21 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 15 May 2014 01:21:56 +0000 (01:21 +0000)
options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208834 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp

index 9ea0a3ab37a763e1eddb8d9ad46e1709038a39c8..79c7e8bd5e25239dc8653e47030fd2e60acd696f 100644 (file)
@@ -492,19 +492,15 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
   Options.TrapFuncName = CodeGenOpts.TrapFuncName;
   Options.PositionIndependentExecutable = LangOpts.PIELevel != 0;
 
+  Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll;
+  Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels;
+  Options.MCOptions.MCUseDwarfDirectory = CodeGenOpts.NoDwarfDirectoryAsm;
+  Options.MCOptions.MCNoExecStack = CodeGenOpts.NoExecStack;
+
   TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU,
                                                      FeaturesStr, Options,
                                                      RM, CM, OptLevel);
 
-  if (CodeGenOpts.RelaxAll)
-    TM->setMCRelaxAll(true);
-  if (CodeGenOpts.SaveTempLabels)
-    TM->setMCSaveTempLabels(true);
-  if (!CodeGenOpts.NoDwarfDirectoryAsm)
-    TM->setMCUseDwarfDirectory(true);
-  if (CodeGenOpts.NoExecStack)
-    TM->setMCNoExecStack(true);
-
   return TM;
 }