namespace llvm {
class MCInst;
+class MCStreamer;
class AsmParser {
AsmLexer Lexer;
+ MCStreamer &Out;
+
struct X86Operand;
public:
- AsmParser(SourceMgr &SM) : Lexer(SM) {}
+ AsmParser(SourceMgr &SM, MCStreamer &OutStr) : Lexer(SM), Out(OutStr) {}
~AsmParser() {}
bool Run();
LEVEL = ../..
TOOLNAME = llvm-mc
-LINK_COMPONENTS := support
+LINK_COMPONENTS := support MC
# This tool has no plugins, optimize startup time.
TOOL_NO_EXPORTS = 1
//
//===----------------------------------------------------------------------===//
+#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCStreamer.h"
+#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
// it later.
SrcMgr.setIncludeDirs(IncludeDirs);
- AsmParser Parser(SrcMgr);
+ // FIXME: don't leak streamer, own.
+ MCContext Ctx;
+ OwningPtr<MCStreamer> Str(createAsmStreamer(Ctx, outs()));
+ AsmParser Parser(SrcMgr, *Str.get());
return Parser.Run();
}