summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorSjoerd Meijer <sjoerd.meijer@arm.com>2017-04-24 08:22:20 +0000
committerSjoerd Meijer <sjoerd.meijer@arm.com>2017-04-24 08:22:20 +0000
commite5b8557d5bc58c96f590b7aa400f9e75e0a3b22f (patch)
treea7e484db002ac48d95bcbfd1ec3ce40981ddadda /llvm/lib/Target
parentb70e88bdec9791538624399131071e56e124641a (diff)
downloadbcm5719-llvm-e5b8557d5bc58c96f590b7aa400f9e75e0a3b22f.tar.gz
bcm5719-llvm-e5b8557d5bc58c96f590b7aa400f9e75e0a3b22f.zip
[Arch64AsmParser] better diagnostic for isb
Instruction isb takes as an operand either 'sy' or an immediate value. This improves the diagnostic when the string is not 'sy' and adds a test case for this which was missing. This also adds tests to check invalid inputs for dsb and dmb. Differential Revision: https://reviews.llvm.org/D32227 llvm-svn: 301165
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index d7bbc2bcd22..4dbcc9581a8 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -2473,16 +2473,14 @@ AArch64AsmParser::tryParseBarrierOperand(OperandVector &Operands) {
return MatchOperand_ParseFail;
}
- auto DB = AArch64DB::lookupDBByName(Tok.getString());
- if (!DB) {
- TokError("invalid barrier option name");
- return MatchOperand_ParseFail;
- }
-
// The only valid named option for ISB is 'sy'
- if (Mnemonic == "isb" && DB->Encoding != AArch64DB::sy) {
+ auto DB = AArch64DB::lookupDBByName(Tok.getString());
+ if (Mnemonic == "isb" && (!DB || DB->Encoding != AArch64DB::sy)) {
TokError("'sy' or #imm operand expected");
return MatchOperand_ParseFail;
+ } else if (!DB) {
+ TokError("invalid barrier option name");
+ return MatchOperand_ParseFail;
}
Operands.push_back(AArch64Operand::CreateBarrier(
OpenPOWER on IntegriCloud