summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2018-06-18 21:03:02 +0000
committerSander de Smalen <sander.desmalen@arm.com>2018-06-18 21:03:02 +0000
commit067eee1c13b664224afcd4392dc86e32ce6de74b (patch)
tree0cdaf81bcdb8071fd78cbd243048641755b59709 /llvm/lib
parentd914fd2163663b4fb7964a6b7001a8182b864705 (diff)
downloadbcm5719-llvm-067eee1c13b664224afcd4392dc86e32ce6de74b.tar.gz
bcm5719-llvm-067eee1c13b664224afcd4392dc86e32ce6de74b.zip
[AArch64][SVE] Asm: Fix predicate pattern diagnostics.
This patch uses the DiagnosticPredicate for SVE predicate patterns to improve their diagnostics, now giving a 'invalid operand' diagnostic if the type is not an immediate or one of the expected pattern labels. Reviewers: samparker, SjoerdMeijer, javed.absar, fhahn Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D48220 llvm-svn: 334983
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index c34ecb24fb5..d042370acf4 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -573,14 +573,16 @@ public:
return DiagnosticPredicateTy::NearMatch;
}
- bool isSVEPattern() const {
+ DiagnosticPredicate isSVEPattern() const {
if (!isImm())
- return false;
+ return DiagnosticPredicateTy::NoMatch;
auto *MCE = dyn_cast<MCConstantExpr>(getImm());
if (!MCE)
- return false;
+ return DiagnosticPredicateTy::NoMatch;
int64_t Val = MCE->getValue();
- return Val >= 0 && Val < 32;
+ if (Val >= 0 && Val < 32)
+ return DiagnosticPredicateTy::Match;
+ return DiagnosticPredicateTy::NearMatch;
}
bool isSymbolicUImm12Offset(const MCExpr *Expr, unsigned Scale) const {
OpenPOWER on IntegriCloud