From eef5c233058eb98b22b7271f20b82974cb664571 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 27 Nov 2017 19:55:16 +0000 Subject: [PATCH] Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables llvm-svn: 319086 --- llvm/include/llvm/CodeGen/CommandFlags.def | 2 +- ...mandFlags.h => MCTargetOptionsCommandFlags.def} | 24 +++++++++++----------- llvm/tools/dsymutil/DwarfLinker.cpp | 2 +- llvm/tools/llvm-dwp/llvm-dwp.cpp | 2 +- .../llvm-mc-assemble-fuzzer.cpp | 2 +- llvm/tools/llvm-mc/llvm-mc.cpp | 2 +- llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp | 7 +++---- 7 files changed, 20 insertions(+), 21 deletions(-) rename llvm/include/llvm/MC/{MCTargetOptionsCommandFlags.h => MCTargetOptionsCommandFlags.def} (77%) diff --git a/llvm/include/llvm/CodeGen/CommandFlags.def b/llvm/include/llvm/CodeGen/CommandFlags.def index ce1a061..83cbeb0 100644 --- a/llvm/include/llvm/CodeGen/CommandFlags.def +++ b/llvm/include/llvm/CodeGen/CommandFlags.def @@ -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" diff --git a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.def similarity index 77% rename from llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h rename to llvm/include/llvm/MC/MCTargetOptionsCommandFlags.def index 96179be..5172fa4 100644 --- a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h +++ b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.def @@ -19,7 +19,7 @@ #include "llvm/Support/CommandLine.h" using namespace llvm; -cl::opt AsmInstrumentation( +static cl::opt AsmInstrumentation( "asm-instrumentation", cl::desc("Instrumentation of inline assembly and " "assembly source files"), cl::init(MCTargetOptions::AsmInstrumentationNone), @@ -28,40 +28,40 @@ cl::opt AsmInstrumentation( clEnumValN(MCTargetOptions::AsmInstrumentationAddress, "address", "instrument instructions with memory arguments"))); -cl::opt RelaxAll("mc-relax-all", +static cl::opt RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, " "relax all fixups in the emitted object file")); -cl::opt IncrementalLinkerCompatible( +static cl::opt 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 PIECopyRelocations("pie-copy-relocations", cl::desc("PIE Copy Relocations")); +static cl::opt PIECopyRelocations("pie-copy-relocations", cl::desc("PIE Copy Relocations")); -cl::opt DwarfVersion("dwarf-version", cl::desc("Dwarf version"), +static cl::opt DwarfVersion("dwarf-version", cl::desc("Dwarf version"), cl::init(0)); -cl::opt ShowMCInst("asm-show-inst", +static cl::opt ShowMCInst("asm-show-inst", cl::desc("Emit internal instruction representation to " "assembly file")); -cl::opt FatalWarnings("fatal-warnings", +static cl::opt FatalWarnings("fatal-warnings", cl::desc("Treat warnings as errors")); -cl::opt NoWarn("no-warn", cl::desc("Suppress all warnings")); -cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn)); +static cl::opt NoWarn("no-warn", cl::desc("Suppress all warnings")); +static cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn)); -cl::opt NoDeprecatedWarn("no-deprecated-warn", +static cl::opt NoDeprecatedWarn("no-deprecated-warn", cl::desc("Suppress all deprecated warnings")); -cl::opt +static cl::opt 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); diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp index 9d98dd8..68f1505 100644 --- a/llvm/tools/dsymutil/DwarfLinker.cpp +++ b/llvm/tools/dsymutil/DwarfLinker.cpp @@ -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" diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp index 59975f3..db017ac 100644 --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -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" diff --git a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp index 96dbc24..efbf3bc 100644 --- a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp +++ b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp @@ -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" diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index 986fe3f..d46f900 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -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" diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp index 9047cf9..08411a0 100644 --- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp @@ -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("no asm backend for target " + TripleName, inconvertibleErrorCode()); @@ -179,7 +179,6 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) { Stream = make_unique(FileBytes); - MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags(); MS = TheTarget->createMCObjectStreamer( TheTriple, *MC, std::unique_ptr(MAB), *Stream, std::unique_ptr(MCE), *MSTI, MCOptions.MCRelaxAll, -- 2.7.4