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 | fdb5a8617996a20370756962e34c2e80176d6e87 (patch) | |
tree | 09d12b286e2ac5b5daaae19c62d6eb3aa856976c /lib/CodeGen/LLVMTargetMachine.cpp | |
parent | 069e4348685e5e7a472787fc9950a081633bf928 (diff) | |
download | external_llvm-fdb5a8617996a20370756962e34c2e80176d6e87.tar.gz external_llvm-fdb5a8617996a20370756962e34c2e80176d6e87.tar.bz2 external_llvm-fdb5a8617996a20370756962e34c2e80176d6e87.zip |
MC: Add an MCLoggingStreamer, for use in debugging integrated-as mismatches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | lib/CodeGen/LLVMTargetMachine.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 9a776ed0e8..48c42406e1 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/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) |