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 | d6347f1b665be97f30a471eebe151e67a62bf7d7 (patch) | |
tree | 09d12b286e2ac5b5daaae19c62d6eb3aa856976c /lib/CodeGen | |
parent | 74f5e7708bda2936249a57105303b589e4b11827 (diff) | |
download | external_llvm-d6347f1b665be97f30a471eebe151e67a62bf7d7.zip external_llvm-d6347f1b665be97f30a471eebe151e67a62bf7d7.tar.gz external_llvm-d6347f1b665be97f30a471eebe151e67a62bf7d7.tar.bz2 |
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')
-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 9a776ed..48c4240 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) |