summaryrefslogtreecommitdiffstats
path: root/tools/llvm-mc/llvm-mc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-mc/llvm-mc.cpp')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index 47f67c5..a114ab0 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,
@@ -75,9 +78,6 @@ FileType("filetype", cl::init(OFT_AssemblyFile),
"Emit a native object ('.o') file"),
clEnumValEnd));
-static cl::opt<bool>
-Force("f", cl::desc("Enable binary output on terminals"));
-
static cl::list<std::string>
IncludeDirs("I", cl::desc("Directory of include files"),
cl::value_desc("directory"), cl::Prefix);
@@ -304,7 +304,12 @@ static int AssembleInput(const char *ProgName) {
assert(FileType == OFT_ObjectFile && "Invalid file type!");
CE.reset(TheTarget->createCodeEmitter(*TM, Ctx));
TAB.reset(TheTarget->createAsmBackend(TripleName));
- Str.reset(createMachOStreamer(Ctx, *TAB, *Out, CE.get(), RelaxAll));
+ Str.reset(TheTarget->createObjectStreamer(TripleName, Ctx, *TAB,
+ *Out, CE.get(), RelaxAll));
+ }
+
+ if (EnableLogging) {
+ Str.reset(createLoggingStreamer(Str.take(), errs()));
}
AsmParser Parser(SrcMgr, Ctx, *Str.get(), *MAI);
OpenPOWER on IntegriCloud