mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 13:10:34 +00:00
create an MCStreamer and provide it to AsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74039 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f4a9061b6b
commit
cbc23f75cd
@ -18,13 +18,16 @@
|
||||
|
||||
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();
|
||||
|
@ -1,4 +1,4 @@
|
||||
set(LLVM_LINK_COMPONENTS support)
|
||||
set(LLVM_LINK_COMPONENTS support MC)
|
||||
|
||||
add_llvm_tool(llvm-mc
|
||||
llvm-mc.cpp
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
LEVEL = ../..
|
||||
TOOLNAME = llvm-mc
|
||||
LINK_COMPONENTS := support
|
||||
LINK_COMPONENTS := support MC
|
||||
|
||||
# This tool has no plugins, optimize startup time.
|
||||
TOOL_NO_EXPORTS = 1
|
||||
|
@ -12,6 +12,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#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"
|
||||
@ -136,7 +139,10 @@ static int AssembleInput(const char *ProgName) {
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user