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
This commit is contained in:
Daniel Dunbar
2010-05-23 17:44:06 +00:00
parent 069e434868
commit fdb5a86179
5 changed files with 229 additions and 2 deletions

View File

@ -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) {