diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-07-17 02:26:10 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-07-17 02:26:10 +0000 |
| commit | 01e3607d70dd082e9a434252fb788a8c712ef886 (patch) | |
| tree | c59a1567db424a2b54fec983efcef80aab4d5abf /llvm/lib/MC/MCParser/MCAsmParser.cpp | |
| parent | 6e3b5fa91c324464c08e84cb7af19df7f0d85cc7 (diff) | |
| download | bcm5719-llvm-01e3607d70dd082e9a434252fb788a8c712ef886.tar.gz bcm5719-llvm-01e3607d70dd082e9a434252fb788a8c712ef886.zip | |
MC/AsmParser: Lift Run() and TargetParser to base class.
Also, add constructor function for creating AsmParser instances.
llvm-svn: 108604
Diffstat (limited to 'llvm/lib/MC/MCParser/MCAsmParser.cpp')
| -rw-r--r-- | llvm/lib/MC/MCParser/MCAsmParser.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/MCAsmParser.cpp b/llvm/lib/MC/MCParser/MCAsmParser.cpp index bee30641c7f..39233aedde0 100644 --- a/llvm/lib/MC/MCParser/MCAsmParser.cpp +++ b/llvm/lib/MC/MCParser/MCAsmParser.cpp @@ -12,14 +12,21 @@ #include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCParsedAsmOperand.h" #include "llvm/Support/SourceMgr.h" +#include "llvm/Target/TargetAsmParser.h" using namespace llvm; -MCAsmParser::MCAsmParser() { +MCAsmParser::MCAsmParser() : TargetParser(0) { } MCAsmParser::~MCAsmParser() { } +void MCAsmParser::setTargetParser(TargetAsmParser &P) { + assert(!TargetParser && "Target parser is already initialized!"); + TargetParser = &P; + TargetParser->Initialize(*this); +} + const AsmToken &MCAsmParser::getTok() { return getLexer().getTok(); } |

