forked from OSchip/llvm-project
Move more MC options into the MCTargetOptions structure.
No functional change. llvm-svn: 208932
This commit is contained in:
parent
98dcb8c6b1
commit
5d376066df
|
@ -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 MCTargetOptions &LHS, const MCTargetOptions &RHS) {
|
|||
ARE_EQUAL(MCRelaxAll) &&
|
||||
ARE_EQUAL(MCNoExecStack) &&
|
||||
ARE_EQUAL(MCSaveTempLabels) &&
|
||||
ARE_EQUAL(MCUseDwarfDirectory));
|
||||
ARE_EQUAL(MCUseDwarfDirectory) &&
|
||||
ARE_EQUAL(ShowMCEncoding) &&
|
||||
ARE_EQUAL(ShowMCInst));
|
||||
#undef ARE_EQUAL
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,11 @@ cl::opt<bool> NoExecStack("mc-no-exec-stack",
|
|||
|
||||
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 InitMCTargetOptionsFromFlags() {
|
|||
Options.MCUseDwarfDirectory = EnableDwarfDirectory;
|
||||
Options.MCNoExecStack = NoExecStack;
|
||||
Options.MCSaveTempLabels = SaveTempLabels;
|
||||
Options.ShowMCEncoding = ShowMCEncoding;
|
||||
Options.ShowMCInst = ShowMCInst;
|
||||
return Options;
|
||||
}
|
||||
|
||||
|
|
|
@ -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::addPassesToEmitFile(PassManagerBase &PM,
|
|||
|
||||
// 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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue