diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-05-23 17:44:06 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-23 17:44:06 +0000 |
commit | 3ff1a06de64ec5c0b343b93d51e49dbdf1bbbdf2 (patch) | |
tree | 0947fdae3472163967f434d6f51f8f2397193bac /llvm/lib/CodeGen | |
parent | 4b636a70d93d6518f11fbba2ffea1c1ee4182b76 (diff) | |
download | bcm5719-llvm-3ff1a06de64ec5c0b343b93d51e49dbdf1bbbdf2.tar.gz bcm5719-llvm-3ff1a06de64ec5c0b343b93d51e49dbdf1bbbdf2.zip |
MC: Add an MCLoggingStreamer, for use in debugging integrated-as mismatches.
llvm-svn: 104463
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 9a776ed0e8d..48c42406e17 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -69,6 +69,8 @@ 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<bool> EnableMCLogging("enable-mc-api-logging", cl::Hidden, + cl::desc("Enable MC API logging")); static cl::opt<bool> VerifyMachineCode("verify-machineinstrs", cl::Hidden, cl::desc("Verify generated machine code"), cl::init(getenv("LLVM_VERIFY_MACHINEINSTRS")!=NULL)); @@ -168,7 +170,10 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, AsmStreamer.reset(createNullStreamer(*Context)); break; } - + + if (EnableMCLogging) + AsmStreamer.reset(createLoggingStreamer(AsmStreamer.take(), errs())); + // Create the AsmPrinter, which takes ownership of AsmStreamer if successful. FunctionPass *Printer = getTarget().createAsmPrinter(*this, *AsmStreamer); if (Printer == 0) |