[llvm-commits] [llvm] r107426 - in /llvm/trunk: include/llvm/MC/MCParser/AsmParser.h lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp lib/MC/MCParser/AsmParser.cpp tools/edis/EDDisassembler.cpp tools/llvm-mc/llvm-mc.cpp
Daniel Dunbar
daniel at zuster.org
Thu Jul 1 13:41:56 PDT 2010
Author: ddunbar
Date: Thu Jul 1 15:41:56 2010
New Revision: 107426
URL: http://llvm.org/viewvc/llvm-project?rev=107426&view=rev
Log:
MC: Pass the target instance to the AsmParser constructor.
Modified:
llvm/trunk/include/llvm/MC/MCParser/AsmParser.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/tools/edis/EDDisassembler.cpp
llvm/trunk/tools/llvm-mc/llvm-mc.cpp
Modified: llvm/trunk/include/llvm/MC/MCParser/AsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCParser/AsmParser.h?rev=107426&r1=107425&r2=107426&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCParser/AsmParser.h (original)
+++ llvm/trunk/include/llvm/MC/MCParser/AsmParser.h Thu Jul 1 15:41:56 2010
@@ -36,11 +36,14 @@
class Twine;
class AsmParser : public MCAsmParser {
+ AsmParser(const AsmParser &); // DO NOT IMPLEMENT
+ void operator=(const AsmParser &); // DO NOT IMPLEMENT
private:
AsmLexer Lexer;
MCContext &Ctx;
MCStreamer &Out;
SourceMgr &SrcMgr;
+ TargetAsmParser *GenericTargetParser;
TargetAsmParser *TargetParser;
/// This is the current buffer index we're lexing from as managed by the
@@ -56,7 +59,7 @@
/// in the directive name and the location of the directive keyword.
StringMap<bool(AsmParser::*)(StringRef, SMLoc)> DirectiveMap;
public:
- AsmParser(SourceMgr &SM, MCContext &Ctx, MCStreamer &Out,
+ AsmParser(const Target &T, SourceMgr &SM, MCContext &Ctx, MCStreamer &Out,
const MCAsmInfo &MAI);
~AsmParser();
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp?rev=107426&r1=107425&r2=107426&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp Thu Jul 1 15:41:56 2010
@@ -83,7 +83,7 @@
// Tell SrcMgr about this buffer, it takes ownership of the buffer.
SrcMgr.AddNewSourceBuffer(Buffer, SMLoc());
- AsmParser Parser(SrcMgr, OutContext, OutStreamer, *MAI);
+ AsmParser Parser(TM.getTarget(), SrcMgr, OutContext, OutStreamer, *MAI);
OwningPtr<TargetAsmParser> TAP(TM.getTarget().createAsmParser(Parser));
if (!TAP)
report_fatal_error("Inline asm not supported by this streamer because"
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=107426&r1=107425&r2=107426&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Thu Jul 1 15:41:56 2010
@@ -32,10 +32,9 @@
enum { DEFAULT_ADDRSPACE = 0 };
-AsmParser::AsmParser(SourceMgr &_SM, MCContext &_Ctx, MCStreamer &_Out,
- const MCAsmInfo &_MAI)
- : Lexer(_MAI), Ctx(_Ctx), Out(_Out), SrcMgr(_SM), TargetParser(0),
- CurBuffer(0) {
+AsmParser::AsmParser(const Target &T, SourceMgr &_SM, MCContext &_Ctx,
+ MCStreamer &_Out, const MCAsmInfo &_MAI)
+ : Lexer(_MAI), Ctx(_Ctx), Out(_Out), SrcMgr(_SM), CurBuffer(0) {
Lexer.setBuffer(SrcMgr.getMemoryBuffer(CurBuffer));
// Debugging directives.
@@ -44,8 +43,6 @@
AddDirectiveHandler(".loc", &AsmParser::ParseDirectiveLoc);
}
-
-
AsmParser::~AsmParser() {
}
Modified: llvm/trunk/tools/edis/EDDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/edis/EDDisassembler.cpp?rev=107426&r1=107425&r2=107426&view=diff
==============================================================================
--- llvm/trunk/tools/edis/EDDisassembler.cpp (original)
+++ llvm/trunk/tools/edis/EDDisassembler.cpp Thu Jul 1 15:41:56 2010
@@ -364,7 +364,7 @@
sourceMgr.AddNewSourceBuffer(buf, SMLoc()); // ownership of buf handed over
MCContext context(*AsmInfo);
OwningPtr<MCStreamer> streamer(createNullStreamer(context));
- AsmParser genericParser(sourceMgr, context, *streamer, *AsmInfo);
+ AsmParser genericParser(*Tgt, sourceMgr, context, *streamer, *AsmInfo);
OwningPtr<TargetAsmParser> TargetParser(Tgt->createAsmParser(genericParser));
AsmToken OpcodeToken = genericParser.Lex();
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=107426&r1=107425&r2=107426&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Thu Jul 1 15:41:56 2010
@@ -312,7 +312,7 @@
Str.reset(createLoggingStreamer(Str.take(), errs()));
}
- AsmParser Parser(SrcMgr, Ctx, *Str.get(), *MAI);
+ AsmParser Parser(*TheTarget, SrcMgr, Ctx, *Str.get(), *MAI);
OwningPtr<TargetAsmParser> TAP(TheTarget->createAsmParser(Parser));
if (!TAP) {
errs() << ProgName
More information about the llvm-commits
mailing list