[llvm] r208932 - Move more MC options into the MCTargetOptions structure.
Eric Christopher
echristo at gmail.com
Thu May 15 16:27:49 PDT 2014
Author: echristo
Date: Thu May 15 18:27:49 2014
New Revision: 208932
URL: http://llvm.org/viewvc/llvm-project?rev=208932&view=rev
Log:
Move more MC options into the MCTargetOptions structure.
No functional change.
Modified:
llvm/trunk/include/llvm/MC/MCTargetOptions.h
llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
llvm/trunk/lib/MC/MCTargetOptions.cpp
Modified: llvm/trunk/include/llvm/MC/MCTargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCTargetOptions.h?rev=208932&r1=208931&r2=208932&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCTargetOptions.h (original)
+++ llvm/trunk/include/llvm/MC/MCTargetOptions.h Thu May 15 18:27:49 2014
@@ -26,7 +26,8 @@ public:
unsigned MCNoExecStack : 1;
unsigned MCSaveTempLabels : 1;
unsigned MCUseDwarfDirectory : 1;
-
+ unsigned ShowMCEncoding : 1;
+ unsigned ShowMCInst : 1;
MCTargetOptions();
};
@@ -36,7 +37,9 @@ inline bool operator==(const MCTargetOpt
ARE_EQUAL(MCRelaxAll) &&
ARE_EQUAL(MCNoExecStack) &&
ARE_EQUAL(MCSaveTempLabels) &&
- ARE_EQUAL(MCUseDwarfDirectory));
+ ARE_EQUAL(MCUseDwarfDirectory) &&
+ ARE_EQUAL(ShowMCEncoding) &&
+ ARE_EQUAL(ShowMCInst));
#undef ARE_EQUAL
}
Modified: llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h?rev=208932&r1=208931&r2=208932&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h (original)
+++ llvm/trunk/include/llvm/MC/MCTargetOptionsCommandFlags.h Thu May 15 18:27:49 2014
@@ -42,6 +42,11 @@ cl::opt<bool> NoExecStack("mc-no-exec-st
cl::opt<bool> SaveTempLabels("L", cl::desc("Don't discard temporary labels"));
+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"));
+
static inline MCTargetOptions InitMCTargetOptionsFromFlags() {
MCTargetOptions Options;
Options.SanitizeAddress =
@@ -50,6 +55,8 @@ static inline MCTargetOptions InitMCTarg
Options.MCUseDwarfDirectory = EnableDwarfDirectory;
Options.MCNoExecStack = NoExecStack;
Options.MCSaveTempLabels = SaveTempLabels;
+ Options.ShowMCEncoding = ShowMCEncoding;
+ Options.ShowMCInst = ShowMCInst;
return Options;
}
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=208932&r1=208931&r2=208932&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu May 15 18:27:49 2014
@@ -43,11 +43,6 @@ static cl::opt<cl::boolOrDefault>
EnableFastISelOption("fast-isel", cl::Hidden,
cl::desc("Enable the \"fast\" instruction selector"));
-static cl::opt<bool> ShowMCEncoding("show-mc-encoding", cl::Hidden,
- cl::desc("Show encoding in .s output"));
-static cl::opt<bool> ShowMCInst("show-mc-inst", cl::Hidden,
- cl::desc("Show instruction structure in .s output"));
-
static cl::opt<cl::boolOrDefault>
AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
cl::init(cl::BOU_UNSET));
@@ -186,17 +181,14 @@ bool LLVMTargetMachine::addPassesToEmitF
// Create a code emitter if asked to show the encoding.
MCCodeEmitter *MCE = nullptr;
- if (ShowMCEncoding)
+ if (Options.MCOptions.ShowMCEncoding)
MCE = getTarget().createMCCodeEmitter(MII, MRI, STI, *Context);
MCAsmBackend *MAB = getTarget().createMCAsmBackend(MRI, getTargetTriple(),
TargetCPU);
- MCStreamer *S = getTarget().createAsmStreamer(*Context, Out,
- getVerboseAsm(),
- hasMCUseDwarfDirectory(),
- InstPrinter,
- MCE, MAB,
- ShowMCInst);
+ MCStreamer *S = getTarget().createAsmStreamer(
+ *Context, Out, getVerboseAsm(), hasMCUseDwarfDirectory(), InstPrinter,
+ MCE, MAB, Options.MCOptions.ShowMCInst);
AsmStreamer.reset(S);
break;
}
Modified: llvm/trunk/lib/MC/MCTargetOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCTargetOptions.cpp?rev=208932&r1=208931&r2=208932&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCTargetOptions.cpp (original)
+++ llvm/trunk/lib/MC/MCTargetOptions.cpp Thu May 15 18:27:49 2014
@@ -13,6 +13,7 @@ namespace llvm {
MCTargetOptions::MCTargetOptions()
: SanitizeAddress(false), MCRelaxAll(false), MCNoExecStack(false),
- MCSaveTempLabels(false), MCUseDwarfDirectory(false) {}
+ MCSaveTempLabels(false), MCUseDwarfDirectory(false),
+ ShowMCEncoding(false), ShowMCInst(false) {}
} // end namespace llvm
More information about the llvm-commits
mailing list