[llvm] r209321 - Move MCOptions that aren't shared between programs into their specific

Eric Christopher echristo at gmail.com
Wed May 21 14:05:10 PDT 2014


Author: echristo
Date: Wed May 21 16:05:09 2014
New Revision: 209321

URL: http://llvm.org/viewvc/llvm-project?rev=209321&view=rev
Log:
Move MCOptions that aren't shared between programs into their specific
program and have them initialize the MCOptions struct explicitly.

Modified:
    llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h
    llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll
    llvm/trunk/test/MC/ELF/noexec.s
    llvm/trunk/tools/llc/llc.cpp
    llvm/trunk/tools/llvm-mc/llvm-mc.cpp

Modified: llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h?rev=209321&r1=209320&r2=209321&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h (original)
+++ llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h Wed May 21 16:05:09 2014
@@ -33,31 +33,11 @@ cl::opt<bool> RelaxAll("mc-relax-all",
                        cl::desc("When used with filetype=obj, "
                                 "relax all fixups in the emitted object file"));
 
-cl::opt<bool> EnableDwarfDirectory(
-    "enable-dwarf-directory", cl::Hidden,
-    cl::desc("Use .file directives with an explicit directory."));
-
-cl::opt<bool> NoExecStack("mc-no-exec-stack",
-                          cl::desc("File doesn't need an exec stack"));
-
-cl::opt<bool> ShowMCEncoding("show-mc-encoding", cl::Hidden,
-                             cl::desc("Show encoding in .s output"));
-cl::opt<bool> ShowMCInst("show-mc-inst", cl::Hidden,
-                         cl::desc("Show instruction structure in .s output"));
-
-cl::opt<bool> AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
-                         cl::init(false));
-
 static inline MCTargetOptions InitMCTargetOptionsFromFlags() {
   MCTargetOptions Options;
   Options.SanitizeAddress =
       (AsmInstrumentation == MCTargetOptions::AsmInstrumentationAddress);
   Options.MCRelaxAll = RelaxAll;
-  Options.MCUseDwarfDirectory = EnableDwarfDirectory;
-  Options.MCNoExecStack = NoExecStack;
-  Options.ShowMCEncoding = ShowMCEncoding;
-  Options.ShowMCInst = ShowMCInst;
-  Options.AsmVerbose = AsmVerbose;
   return Options;
 }
 

Modified: llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll?rev=209321&r1=209320&r2=209321&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll (original)
+++ llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll Wed May 21 16:05:09 2014
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -verify -S -asm-verbose | FileCheck %s
+; RUN: llvm-as < %s | opt -verify -S | FileCheck %s
 
 ; CHECK: lang 0x8001
 

Modified: llvm/trunk/test/MC/ELF/noexec.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/noexec.s?rev=209321&r1=209320&r2=209321&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/noexec.s (original)
+++ llvm/trunk/test/MC/ELF/noexec.s Wed May 21 16:05:09 2014
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -mc-no-exec-stack -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -t | FileCheck  %s
+// RUN: llvm-mc -no-exec-stack -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -t | FileCheck  %s
 
 // CHECK:        Section {
 // CHECK:          Index: 4

Modified: llvm/trunk/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=209321&r1=209320&r2=209321&view=diff
==============================================================================
--- llvm/trunk/tools/llc/llc.cpp (original)
+++ llvm/trunk/tools/llc/llc.cpp Wed May 21 16:05:09 2014
@@ -81,7 +81,18 @@ static cl::opt<bool> NoVerify("disable-v
 static cl::opt<bool> DisableSimplifyLibCalls("disable-simplify-libcalls",
                                              cl::desc("Disable simplify-libcalls"));
 
-static int compileModule(char**, LLVMContext&);
+static cl::opt<bool> ShowMCEncoding("show-mc-encoding", cl::Hidden,
+                                    cl::desc("Show encoding in .s output"));
+
+static cl::opt<bool> EnableDwarfDirectory(
+    "enable-dwarf-directory", cl::Hidden,
+    cl::desc("Use .file directives with an explicit directory."));
+
+static cl::opt<bool> AsmVerbose("asm-verbose",
+                                cl::desc("Add comments to directives."),
+                                cl::init(true));
+
+static int compileModule(char **, LLVMContext &);
 
 // GetFileNameRoot - Helper function to get the basename of a filename.
 static inline std::string
@@ -270,10 +281,9 @@ static int compileModule(char **argv, LL
 
   TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
   Options.DisableIntegratedAS = NoIntegratedAssembler;
-
-  // Override default to generate verbose assembly unless we've seen the flag.
-  if (AsmVerbose.getNumOccurrences() == 0)
-    Options.MCOptions.AsmVerbose = true;
+  Options.MCOptions.ShowMCEncoding = ShowMCEncoding;
+  Options.MCOptions.MCUseDwarfDirectory = EnableDwarfDirectory;
+  Options.MCOptions.AsmVerbose = AsmVerbose;
 
   std::unique_ptr<TargetMachine> target(
       TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr,

Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=209321&r1=209320&r2=209321&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Wed May 21 16:05:09 2014
@@ -159,6 +159,9 @@ MainFileName("main-file-name",
 static cl::opt<bool> SaveTempLabels("save-temp-labels",
                                     cl::desc("Don't discard temporary labels"));
 
+static cl::opt<bool> NoExecStack("no-exec-stack",
+                                 cl::desc("File doesn't need an exec stack"));
+
 enum ActionType {
   AC_AsLex,
   AC_Assemble,





More information about the llvm-commits mailing list