[llvm-branch-commits] [SPARC][IAS] Rework ASI tag matching in prep for `ParseForAllFeatures` (PR #96020)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jun 21 08:50:08 PDT 2024
================
@@ -1085,13 +1085,24 @@ ParseStatus SparcAsmParser::parseASITag(OperandVector &Operands) {
SMLoc E = Parser.getTok().getEndLoc();
int64_t ASIVal = 0;
- if (is64Bit() && (getLexer().getKind() == AsmToken::Hash)) {
+ switch (getLexer().getKind()) {
+ case AsmToken::LParen:
+ case AsmToken::Integer:
+ case AsmToken::Identifier:
+ case AsmToken::Plus:
+ case AsmToken::Minus:
+ case AsmToken::Tilde:
----------------
koachan wrote:
> Also, optionally, add a parseExpression method that returns NoMatch if the first token can't start an expression and Success/Failure if it can and expression parsing succeeded/failed.
Hmm, not sure how would I use this in the ASI/Prefetch tag parsing...
I'm thinking about calling `parseExpression` then checking if the return value is a `Success` before further checking if the returned value is in range for each tag type, but apparently comparing `ParseStatus`es is an error?
```
[clang] (typecheck_invalid_operands) Invalid operands to binary expression ('ParseStatus' and 'const StatusTy')
```
https://github.com/llvm/llvm-project/pull/96020
More information about the llvm-branch-commits
mailing list