[llvm-commits] [llvm] r74039 - in /llvm/trunk/tools/llvm-mc: AsmParser.h CMakeLists.txt Makefile llvm-mc.cpp
Chris Lattner
sabre at nondot.org
Tue Jun 23 17:52:40 PDT 2009
Author: lattner
Date: Tue Jun 23 19:52:40 2009
New Revision: 74039
URL: http://llvm.org/viewvc/llvm-project?rev=74039&view=rev
Log:
create an MCStreamer and provide it to AsmParser.
Modified:
llvm/trunk/tools/llvm-mc/AsmParser.h
llvm/trunk/tools/llvm-mc/CMakeLists.txt
llvm/trunk/tools/llvm-mc/Makefile
llvm/trunk/tools/llvm-mc/llvm-mc.cpp
Modified: llvm/trunk/tools/llvm-mc/AsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.h?rev=74039&r1=74038&r2=74039&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.h (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.h Tue Jun 23 19:52:40 2009
@@ -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();
Modified: llvm/trunk/tools/llvm-mc/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/CMakeLists.txt?rev=74039&r1=74038&r2=74039&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-mc/CMakeLists.txt Tue Jun 23 19:52:40 2009
@@ -1,4 +1,4 @@
-set(LLVM_LINK_COMPONENTS support)
+set(LLVM_LINK_COMPONENTS support MC)
add_llvm_tool(llvm-mc
llvm-mc.cpp
Modified: llvm/trunk/tools/llvm-mc/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/Makefile?rev=74039&r1=74038&r2=74039&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/Makefile (original)
+++ llvm/trunk/tools/llvm-mc/Makefile Tue Jun 23 19:52:40 2009
@@ -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
Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=74039&r1=74038&r2=74039&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Tue Jun 23 19:52:40 2009
@@ -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 @@
// 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();
}
More information about the llvm-commits
mailing list