diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-02 22:54:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-02 22:54:51 +0000 |
commit | 1f21990284906b1d3ed244d99808c6dade04d295 (patch) | |
tree | 9025f14a77cbc41a6da8a372ef88a40b17c9bcda | |
parent | 2e438c3a70dcd445f99f562e57715296e3cacc08 (diff) |
move handling of asm-verbose out of AsmPrinter.cpp into LLVMTargetMachine.cpp with the rest of the command line options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95152 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 19 | ||||
-rw-r--r-- | lib/CodeGen/LLVMTargetMachine.cpp | 14 |
2 files changed, 16 insertions, 17 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 36aa748426..49db51ea0b 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -53,22 +53,9 @@ using namespace llvm; STATISTIC(EmittedInsts, "Number of machine instrs printed"); -static cl::opt<cl::boolOrDefault> -AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), - cl::init(cl::BOU_UNSET)); - -static bool getVerboseAsm(bool VDef) { - switch (AsmVerbose) { - default: - case cl::BOU_UNSET: return VDef; - case cl::BOU_TRUE: return true; - case cl::BOU_FALSE: return false; - } -} - char AsmPrinter::ID = 0; AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm, - const MCAsmInfo *T, bool VDef) + const MCAsmInfo *T, bool VerboseAsm) : MachineFunctionPass(&ID), O(o), TM(tm), MAI(T), TRI(tm.getRegisterInfo()), @@ -76,11 +63,11 @@ AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm, // FIXME: Pass instprinter to streamer. OutStreamer(*createAsmStreamer(OutContext, O, *T, TM.getTargetData()->isLittleEndian(), - getVerboseAsm(VDef), 0)), + VerboseAsm, 0)), LastMI(0), LastFn(0), Counter(~0U), PrevDLT(NULL) { DW = 0; MMI = 0; - VerboseAsm = getVerboseAsm(VDef); + this->VerboseAsm = VerboseAsm; } AsmPrinter::~AsmPrinter() { diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index bc9ddbb392..3063e5e1ef 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -62,6 +62,18 @@ static cl::opt<bool> VerifyMachineCode("verify-machineinstrs", cl::Hidden, cl::desc("Verify generated machine code"), cl::init(getenv("LLVM_VERIFY_MACHINEINSTRS")!=NULL)); +static cl::opt<cl::boolOrDefault> +AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), + cl::init(cl::BOU_UNSET)); + +static bool getVerboseAsm(bool VDef) { + switch (AsmVerbose) { + default: + case cl::BOU_UNSET: return VDef; + case cl::BOU_TRUE: return true; + case cl::BOU_FALSE: return false; + } +} // Enable or disable FastISel. Both options are needed, because // FastISel is enabled by default with -fast, and we wish to be @@ -111,7 +123,7 @@ LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, case CGFT_AssemblyFile: { FunctionPass *Printer = getTarget().createAsmPrinter(Out, *this, getMCAsmInfo(), - getAsmVerbosityDefault()); + getVerboseAsm(getAsmVerbosityDefault())); if (Printer == 0) return CGFT_ErrorOccurred; PM.add(Printer); break; |