[clang] [CIR] Add custom assembly format for alloca op to fix flag parsing (PR #198962)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Thu May 21 06:35:32 PDT 2026
xlauko wrote:
> > What about changing the format non-ambiguous parse that does not need lookahead, i.e. dropping commas:
> > ```
> > let assemblyFormat = [{
> > $allocaType `,` qualified(type($addr)) `,`
> > ($dynAllocSize^ `:` type($dynAllocSize) `,`)?
> > `[` $name
> > oilist( `init` $init
> > | `const` $constant
> > | `cleanup_dest_slot` $cleanup_dest_slot )
> > `]`
> > ($annotations^)? attr-dict
> > }];
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > or adding `comma-separated-oilist` to mlir tablegen?
>
> yes that works, i did it this way because i wanted to maintain the current format and avoid changing all the test cases 😅 since dropping the comma would break them, but if you prefer the oilist approach i can change it.
Yeah I got it, and if we are to change format we can make it a bit more uniform with other operations. It is a weird that alloca has some attributes in surrounded by `[` `]`. Not sure what would be the best here. @andykaylor @erichkeane would you have a preference or do we want to keep old format and custom printer/parser?
https://github.com/llvm/llvm-project/pull/198962
More information about the cfe-commits
mailing list