Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header...
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 27 Nov 2017 19:55:16 +0000 (19:55 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 27 Nov 2017 19:55:16 +0000 (19:55 +0000)
llvm-svn: 319086

llvm/include/llvm/CodeGen/CommandFlags.def
llvm/include/llvm/MC/MCTargetOptionsCommandFlags.def [moved from llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h with 77% similarity]
llvm/tools/dsymutil/DwarfLinker.cpp
llvm/tools/llvm-dwp/llvm-dwp.cpp
llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
llvm/tools/llvm-mc/llvm-mc.cpp
llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp

index ce1a061..83cbeb0 100644 (file)
@@ -17,7 +17,7 @@
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Module.h"
-#include "llvm/MC/MCTargetOptionsCommandFlags.h"
+#include "llvm/MC/MCTargetOptionsCommandFlags.def"
 #include "llvm/MC/SubtargetFeature.h"
 #include "llvm/Support/CodeGen.h"
 #include "llvm/Support/CommandLine.h"
@@ -19,7 +19,7 @@
 #include "llvm/Support/CommandLine.h"
 using namespace llvm;
 
-cl::opt<MCTargetOptions::AsmInstrumentation> AsmInstrumentation(
+static cl::opt<MCTargetOptions::AsmInstrumentation> AsmInstrumentation(
     "asm-instrumentation", cl::desc("Instrumentation of inline assembly and "
                                     "assembly source files"),
     cl::init(MCTargetOptions::AsmInstrumentationNone),
@@ -28,40 +28,40 @@ cl::opt<MCTargetOptions::AsmInstrumentation> AsmInstrumentation(
                clEnumValN(MCTargetOptions::AsmInstrumentationAddress, "address",
                           "instrument instructions with memory arguments")));
 
-cl::opt<bool> RelaxAll("mc-relax-all",
+static 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> IncrementalLinkerCompatible(
+static cl::opt<bool> IncrementalLinkerCompatible(
     "incremental-linker-compatible",
     cl::desc(
         "When used with filetype=obj, "
         "emit an object file which can be used with an incremental linker"));
 
-cl::opt<bool> PIECopyRelocations("pie-copy-relocations", cl::desc("PIE Copy Relocations"));
+static cl::opt<bool> PIECopyRelocations("pie-copy-relocations", cl::desc("PIE Copy Relocations"));
 
-cl::opt<int> DwarfVersion("dwarf-version", cl::desc("Dwarf version"),
+static cl::opt<int> DwarfVersion("dwarf-version", cl::desc("Dwarf version"),
                           cl::init(0));
 
-cl::opt<bool> ShowMCInst("asm-show-inst",
+static cl::opt<bool> ShowMCInst("asm-show-inst",
                          cl::desc("Emit internal instruction representation to "
                                   "assembly file"));
 
-cl::opt<bool> FatalWarnings("fatal-warnings",
+static cl::opt<bool> FatalWarnings("fatal-warnings",
                             cl::desc("Treat warnings as errors"));
 
-cl::opt<bool> NoWarn("no-warn", cl::desc("Suppress all warnings"));
-cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn));
+static cl::opt<bool> NoWarn("no-warn", cl::desc("Suppress all warnings"));
+static cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn));
 
-cl::opt<bool> NoDeprecatedWarn("no-deprecated-warn",
+static cl::opt<bool> NoDeprecatedWarn("no-deprecated-warn",
                                cl::desc("Suppress all deprecated warnings"));
 
-cl::opt<std::string>
+static cl::opt<std::string>
 ABIName("target-abi", cl::Hidden,
         cl::desc("The name of the ABI to be targeted from the backend."),
         cl::init(""));
 
-static inline MCTargetOptions InitMCTargetOptionsFromFlags() {
+static MCTargetOptions InitMCTargetOptionsFromFlags() {
   MCTargetOptions Options;
   Options.SanitizeAddress =
       (AsmInstrumentation == MCTargetOptions::AsmInstrumentationAddress);
index 9d98dd8..68f1505 100644 (file)
@@ -55,7 +55,7 @@
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/MC/MCSubtargetInfo.h"
 #include "llvm/MC/MCTargetOptions.h"
-#include "llvm/MC/MCTargetOptionsCommandFlags.h"
+#include "llvm/MC/MCTargetOptionsCommandFlags.def"
 #include "llvm/Object/MachO.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Object/SymbolicFile.h"
index 59975f3..db017ac 100644 (file)
@@ -29,7 +29,7 @@
 #include "llvm/MC/MCRegisterInfo.h"
 #include "llvm/MC/MCSectionELF.h"
 #include "llvm/MC/MCStreamer.h"
-#include "llvm/MC/MCTargetOptionsCommandFlags.h"
+#include "llvm/MC/MCTargetOptionsCommandFlags.def"
 #include "llvm/Object/Decompressor.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Support/Compression.h"
index 96dbc24..efbf3bc 100644 (file)
@@ -24,7 +24,7 @@
 #include "llvm/MC/MCSectionMachO.h"
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/MC/MCSubtargetInfo.h"
-#include "llvm/MC/MCTargetOptionsCommandFlags.h"
+#include "llvm/MC/MCTargetOptionsCommandFlags.def"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FileUtilities.h"
index 986fe3f..d46f900 100644 (file)
@@ -26,7 +26,7 @@
 #include "llvm/MC/MCSectionMachO.h"
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/MC/MCSubtargetInfo.h"
-#include "llvm/MC/MCTargetOptionsCommandFlags.h"
+#include "llvm/MC/MCTargetOptionsCommandFlags.def"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Compression.h"
 #include "llvm/Support/FileUtilities.h"
index 9047cf9..08411a0 100644 (file)
@@ -27,7 +27,7 @@
 #include "llvm/MC/MCRegisterInfo.h"
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/MC/MCSubtargetInfo.h"
-#include "llvm/MC/MCTargetOptionsCommandFlags.h"
+#include "llvm/MC/MCTargetOptionsCommandFlags.def"
 #include "llvm/PassAnalysisSupport.h"
 #include "llvm/Support/LEB128.h"
 #include "llvm/Support/TargetRegistry.h"
@@ -155,8 +155,8 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) {
   MC.reset(new MCContext(MAI.get(), MRI.get(), MOFI.get()));
   MOFI->InitMCObjectFileInfo(TheTriple, /*PIC*/ false, *MC);
 
-  MCTargetOptions Options;
-  MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, "", Options);
+  MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
+  MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, "", MCOptions);
   if (!MAB)
     return make_error<StringError>("no asm backend for target " + TripleName,
                                    inconvertibleErrorCode());
@@ -179,7 +179,6 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) {
 
   Stream = make_unique<raw_svector_ostream>(FileBytes);
 
-  MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
   MS = TheTarget->createMCObjectStreamer(
       TheTriple, *MC, std::unique_ptr<MCAsmBackend>(MAB), *Stream,
       std::unique_ptr<MCCodeEmitter>(MCE), *MSTI, MCOptions.MCRelaxAll,