[llvm] [TableGen] Add let append/prepend syntax for field concatenation (PR #182382)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 6 07:56:42 PST 2026
================
@@ -3637,8 +3689,15 @@ bool TGParser::ParseBodyItem(Record *CurRec) {
return false;
}
- // LET ID OptionalRangeList '=' Value ';'
- if (Lex.Lex() != tgtok::Id)
+ // LET [append|prepend] ID OptionalBitList '=' Value ';'
+ Lex.Lex(); // eat 'let'.
+
+ if (Lex.getCode() != tgtok::Id)
----------------
jurahul wrote:
what happens if we have existing fields with names append or prepend?
```
class X {
int append = 0;
}
class Y : X {
let append = 1;
}
```
This I think will parse currently and fail with the new code? Should we interpret the `append` and `prepend` as LetModes only when they are followed with an identifier?
https://github.com/llvm/llvm-project/pull/182382
More information about the llvm-commits
mailing list