summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-03-25 01:47:28 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-03-25 01:47:28 +0000
commit5e5a63cf8f9ba2c46239961d0d4443795790eab4 (patch)
tree5b04a3c2ad679084ff9dd30e6ff436bb1946e60d /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent9966403e900ce6c78c1d1e9dbb54337b0a84ea41 (diff)
downloadbcm5719-llvm-5e5a63cf8f9ba2c46239961d0d4443795790eab4.tar.gz
bcm5719-llvm-5e5a63cf8f9ba2c46239961d0d4443795790eab4.zip
CodeGen still defaults to non-verbose asm, but llc now overrides it and default to verbose.
llvm-svn: 67668
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index e6205957c7f..48085d59a26 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -21,6 +21,7 @@
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/DwarfWriter.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetAsmInfo.h"
@@ -35,13 +36,23 @@
#include <cerrno>
using namespace llvm;
+static cl::opt<cl::boolOrDefault>
+AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
+ cl::init(cl::BOU_UNSET));
+
char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm,
- const TargetAsmInfo *T, bool F)
+ const TargetAsmInfo *T, bool F, bool VDef)
: MachineFunctionPass(&ID), FunctionNumber(0), Fast(F), O(o),
TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
IsInTextSection(false)
-{}
+{
+ switch (AsmVerbose) {
+ case cl::BOU_UNSET: VerboseAsm = VDef; break;
+ case cl::BOU_TRUE: VerboseAsm = true; break;
+ case cl::BOU_FALSE: VerboseAsm = false; break;
+ }
+}
AsmPrinter::~AsmPrinter() {
for (gcp_iterator I = GCMetadataPrinters.begin(),
OpenPOWER on IntegriCloud