summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorColin LeMahieu <colinl@codeaurora.org>2015-11-09 00:15:45 +0000
committerColin LeMahieu <colinl@codeaurora.org>2015-11-09 00:15:45 +0000
commit7820dff228eba0d25222ef0361773e8ce6eda18c (patch)
tree9c21db8002273f71960fb760950891ca94e3c80b /llvm/lib
parent2d7ec5a970057b8feaaf9a6550ba0ade53cb6ea7 (diff)
downloadbcm5719-llvm-7820dff228eba0d25222ef0361773e8ce6eda18c.tar.gz
bcm5719-llvm-7820dff228eba0d25222ef0361773e8ce6eda18c.zip
[AsmParser] Provide target direct access to mnemonic token. Allow assignment parsing to be hooked by target. Allow target to specify if identifier is a label.
Differential Revision: http://reviews.llvm.org/D14255 llvm-svn: 252435
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 89036376780..aa3489a0573 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -1396,6 +1396,8 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
// See what kind of statement we have.
switch (Lexer.getKind()) {
case AsmToken::Colon: {
+ if (!getTargetParser().isLabel(ID))
+ break;
checkForValidSection();
// identifier ':' -> Label.
@@ -1454,6 +1456,8 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
}
case AsmToken::Equal:
+ if (!getTargetParser().equalIsAsmAssignment())
+ break;
// identifier '=' ... -> assignment statement
Lex();
@@ -1701,7 +1705,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
// Canonicalize the opcode to lower case.
std::string OpcodeStr = IDVal.lower();
ParseInstructionInfo IInfo(Info.AsmRewrites);
- bool HadError = getTargetParser().ParseInstruction(IInfo, OpcodeStr, IDLoc,
+ bool HadError = getTargetParser().ParseInstruction(IInfo, OpcodeStr, ID,
Info.ParsedOperands);
Info.ParseError = HadError;
OpenPOWER on IntegriCloud