summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-02 22:54:51 +0000
committerChris Lattner <sabre@nondot.org>2010-02-02 22:54:51 +0000
commit32445d300fd49e719b38ac66e165d81c9959cbce (patch)
treecd1210272aa7690628be667bf3d5c84332596bc5 /llvm/lib/CodeGen/LLVMTargetMachine.cpp
parentb251eb69019a5370dc6cd6826d6025a1a1a92e53 (diff)
downloadbcm5719-llvm-32445d300fd49e719b38ac66e165d81c9959cbce.tar.gz
bcm5719-llvm-32445d300fd49e719b38ac66e165d81c9959cbce.zip
move handling of asm-verbose out of AsmPrinter.cpp into LLVMTargetMachine.cpp with the rest of the command line options.
llvm-svn: 95152
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index bc9ddbb392a..3063e5e1efd 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud