2009-07-20 18:55:04 +00:00
|
|
|
//===-- MCAsmParser.cpp - Abstract Asm Parser Interface -------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-01-22 01:44:57 +00:00
|
|
|
#include "llvm/MC/MCParser/MCAsmParser.h"
|
2010-07-12 17:18:45 +00:00
|
|
|
#include "llvm/ADT/Twine.h"
|
2010-01-22 01:44:57 +00:00
|
|
|
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
|
|
|
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
|
2010-01-15 19:28:38 +00:00
|
|
|
#include "llvm/Support/SourceMgr.h"
|
2010-07-17 02:26:10 +00:00
|
|
|
#include "llvm/Target/TargetAsmParser.h"
|
2009-07-20 18:55:04 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2010-08-11 06:37:09 +00:00
|
|
|
MCAsmParser::MCAsmParser() : TargetParser(0), ShowParsedOperands(0) {
|
2009-07-20 18:55:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MCAsmParser::~MCAsmParser() {
|
|
|
|
}
|
2010-01-15 19:28:38 +00:00
|
|
|
|
2010-07-17 02:26:10 +00:00
|
|
|
void MCAsmParser::setTargetParser(TargetAsmParser &P) {
|
|
|
|
assert(!TargetParser && "Target parser is already initialized!");
|
|
|
|
TargetParser = &P;
|
|
|
|
TargetParser->Initialize(*this);
|
|
|
|
}
|
|
|
|
|
2010-01-19 21:44:56 +00:00
|
|
|
const AsmToken &MCAsmParser::getTok() {
|
|
|
|
return getLexer().getTok();
|
|
|
|
}
|
|
|
|
|
2010-07-18 18:31:42 +00:00
|
|
|
bool MCAsmParser::TokError(const Twine &Msg) {
|
2010-07-12 17:18:45 +00:00
|
|
|
Error(getLexer().getLoc(), Msg);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-01-15 19:28:38 +00:00
|
|
|
bool MCAsmParser::ParseExpression(const MCExpr *&Res) {
|
|
|
|
SMLoc L;
|
2010-01-15 19:51:05 +00:00
|
|
|
return ParseExpression(Res, L);
|
2010-01-15 19:28:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|