[clang] [NFC][OpenACC] Remove 'initExpr' from AST/etc. (PR #161674)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 2 09:56:29 PDT 2025


================
@@ -899,18 +898,17 @@ class OpenACCPrivateClause final
 // InitFromTemporary is the 'temp' declaration we put in to be 'copied from'.
 struct OpenACCFirstPrivateRecipe {
   VarDecl *AllocaDecl;
-  Expr *InitExpr;
   VarDecl *InitFromTemporary;
-  OpenACCFirstPrivateRecipe(VarDecl *A, Expr *I, VarDecl *T)
-      : AllocaDecl(A), InitExpr(I), InitFromTemporary(T) {
-    assert(!AllocaDecl || AllocaDecl->getInit() == nullptr);
----------------
erichkeane wrote:

Yes, I do.  I was asserting it in the past because I was storing `InitExpr` and `AllocaDecl` separately.  What this patch does is instead store them together, putting the `InitExpr` in the `getInit` of the `AllocaDecl`.  

THIS assert was in place to make sure I wasn't counting on that (written with the misunderstanding that they'd be of different types/nodes), and now the point/purpose of this patch is I actually AM counting on that.

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


More information about the cfe-commits mailing list