Move the TargetMachine MC options to MCTargetOptions. No functional
authorEric Christopher <echristo@gmail.com>
Thu, 15 May 2014 01:08:00 +0000 (01:08 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 15 May 2014 01:08:00 +0000 (01:08 +0000)
change.

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

include/llvm/MC/MCTargetOptions.h
include/llvm/Target/TargetMachine.h
lib/MC/MCTargetOptions.cpp
lib/Target/TargetMachine.cpp

index 3adaf0d5bd791ea0b31c9f203935551dfd17d6fb..225ed7d85f9208721496bf096932669b72cccde9 100644 (file)
@@ -22,12 +22,21 @@ public:
   /// Enables AddressSanitizer instrumentation at machine level.
   bool SanitizeAddress : 1;
 
+  unsigned MCRelaxAll : 1;
+  unsigned MCNoExecStack : 1;
+  unsigned MCSaveTempLabels : 1;
+  unsigned MCUseDwarfDirectory : 1;
+
   MCTargetOptions();
 };
 
 inline bool operator==(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
 #define ARE_EQUAL(X) LHS.X == RHS.X
-  return ARE_EQUAL(SanitizeAddress);
+  return (ARE_EQUAL(SanitizeAddress) &&
+          ARE_EQUAL(MCRelaxAll) &&
+          ARE_EQUAL(MCNoExecStack) &&
+          ARE_EQUAL(MCSaveTempLabels) &&
+          ARE_EQUAL(MCUseDwarfDirectory));
 #undef ARE_EQUAL
 }
 
index 151be732112f5824a68846793fdeb762e5d2e5ff..905cbc663199981bd1dac5adf0e6cdfb3436ac00 100644 (file)
@@ -84,10 +84,6 @@ protected: // Can only create subclasses.
   ///
   const MCAsmInfo *AsmInfo;
 
-  unsigned MCRelaxAll : 1;
-  unsigned MCNoExecStack : 1;
-  unsigned MCSaveTempLabels : 1;
-  unsigned MCUseDwarfDirectory : 1;
   unsigned RequireStructuredCFG : 1;
 
 public:
@@ -168,33 +164,33 @@ public:
 
   /// hasMCRelaxAll - Check whether all machine code instructions should be
   /// relaxed.
-  bool hasMCRelaxAll() const { return MCRelaxAll; }
+  bool hasMCRelaxAll() const { return Options.MCOptions.MCRelaxAll; }
 
   /// setMCRelaxAll - Set whether all machine code instructions should be
   /// relaxed.
-  void setMCRelaxAll(bool Value) { MCRelaxAll = Value; }
+  void setMCRelaxAll(bool Value) { Options.MCOptions.MCRelaxAll = Value; }
 
   /// hasMCSaveTempLabels - Check whether temporary labels will be preserved
   /// (i.e., not treated as temporary).
-  bool hasMCSaveTempLabels() const { return MCSaveTempLabels; }
+  bool hasMCSaveTempLabels() const { return Options.MCOptions.MCSaveTempLabels; }
 
   /// setMCSaveTempLabels - Set whether temporary labels will be preserved
   /// (i.e., not treated as temporary).
-  void setMCSaveTempLabels(bool Value) { MCSaveTempLabels = Value; }
+  void setMCSaveTempLabels(bool Value) { Options.MCOptions.MCSaveTempLabels = Value; }
 
   /// hasMCNoExecStack - Check whether an executable stack is not needed.
-  bool hasMCNoExecStack() const { return MCNoExecStack; }
+  bool hasMCNoExecStack() const { return Options.MCOptions.MCNoExecStack; }
 
   /// setMCNoExecStack - Set whether an executabel stack is not needed.
-  void setMCNoExecStack(bool Value) { MCNoExecStack = Value; }
+  void setMCNoExecStack(bool Value) { Options.MCOptions.MCNoExecStack = Value; }
 
   /// hasMCUseDwarfDirectory - Check whether we should use .file directives with
   /// explicit directories.
-  bool hasMCUseDwarfDirectory() const { return MCUseDwarfDirectory; }
+  bool hasMCUseDwarfDirectory() const { return Options.MCOptions.MCUseDwarfDirectory; }
 
   /// setMCUseDwarfDirectory - Set whether all we should use .file directives
   /// with explicit directories.
-  void setMCUseDwarfDirectory(bool Value) { MCUseDwarfDirectory = Value; }
+  void setMCUseDwarfDirectory(bool Value) { Options.MCOptions.MCUseDwarfDirectory = Value; }
 
   /// getRelocationModel - Returns the code generation relocation model. The
   /// choices are static, PIC, and dynamic-no-pic, and target default.
index a38990934d9cd38fa3ca30ce4631b2cc12434cee..0bcfce9eac9be0f73689af2040931c6df190c6f0 100644 (file)
@@ -11,6 +11,8 @@
 
 namespace llvm {
 
-MCTargetOptions::MCTargetOptions() : SanitizeAddress(false) {}
+MCTargetOptions::MCTargetOptions()
+    : SanitizeAddress(false), MCRelaxAll(false), MCNoExecStack(false),
+      MCSaveTempLabels(false), MCUseDwarfDirectory(false) {}
 
 } // end namespace llvm
index 741209162a5cf897f0f46a7f4902ce9d97a09622..d60a70846a768a9747bdfbc4c4db958962d97ad6 100644 (file)
@@ -55,10 +55,6 @@ TargetMachine::TargetMachine(const Target &T,
                              const TargetOptions &Options)
   : TheTarget(T), TargetTriple(TT), TargetCPU(CPU), TargetFS(FS),
     CodeGenInfo(nullptr), AsmInfo(nullptr),
-    MCRelaxAll(false),
-    MCNoExecStack(false),
-    MCSaveTempLabels(false),
-    MCUseDwarfDirectory(false),
     RequireStructuredCFG(false),
     Options(Options) {
 }