[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 08:13:18 PDT 2024


erichkeane wrote:

@alexey-bataev 
Not having this new 'base' type as a member of the `StmtNodes.td` results in one of the Clang tools failing (see the CI).  AND, since it is a template, it can't do that.

I can't make it a Mixin, because it needs to provide some of the Expr-type functions regarding source location/etc.

So I don't have a great idea on how to have reuse between the two while still having them be separate AST nodes (as there IS a bit of a difference in behaviors).  

I COULD just move the OMP type to Expr.h (renamed as just ArraySectionExpr), add a flag for OMP vs OpenACC, then make the logic of each function check it, but I'm tentative as to whether that is better.

https://github.com/llvm/llvm-project/pull/89639


More information about the cfe-commits mailing list