summaryrefslogtreecommitdiff
path: root/tools/llvm-mc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-mc')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index ca098e17b6..a114ab0c3f 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -58,6 +58,9 @@ OutputAsmVariant("output-asm-variant",
static cl::opt<bool>
RelaxAll("mc-relax-all", cl::desc("Relax all fixups"));
+static cl::opt<bool>
+EnableLogging("enable-api-logging", cl::desc("Enable MC API logging"));
+
enum OutputFileType {
OFT_Null,
OFT_AssemblyFile,
@@ -305,6 +308,10 @@ static int AssembleInput(const char *ProgName) {
*Out, CE.get(), RelaxAll));
}
+ if (EnableLogging) {
+ Str.reset(createLoggingStreamer(Str.take(), errs()));
+ }
+
AsmParser Parser(SrcMgr, Ctx, *Str.get(), *MAI);
OwningPtr<TargetAsmParser> TAP(TheTarget->createAsmParser(Parser));
if (!TAP) {