Skip to content

Conversation

@erichkeane
Copy link
Collaborator

I used 'expr' since that is what it is in the standard, but that obviously conflicts with our warnings on some build bots. This patch fixes that by renaming it.

I used 'expr' since that is what it is in the standard, but that
obviously conflicts with our warnings on some build bots. This patch
fixes that by renaming it.
@erichkeane erichkeane enabled auto-merge (squash) October 23, 2025 14:40
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" ClangIR Anything related to the ClangIR project labels Oct 23, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 23, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clangir

Author: Erich Keane (erichkeane)

Changes

I used 'expr' since that is what it is in the standard, but that obviously conflicts with our warnings on some build bots. This patch fixes that by renaming it.


Full diff: https://github.com/llvm/llvm-project/pull/164828.diff

2 Files Affected:

  • (modified) clang/include/clang/AST/StmtOpenACC.h (+3-1)
  • (modified) clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp (+1-1)
diff --git a/clang/include/clang/AST/StmtOpenACC.h b/clang/include/clang/AST/StmtOpenACC.h
index f5240251b67af..ae8029797a36e 100644
--- a/clang/include/clang/AST/StmtOpenACC.h
+++ b/clang/include/clang/AST/StmtOpenACC.h
@@ -821,7 +821,9 @@ class OpenACCAtomicConstruct final
   struct StmtInfo {
     const Expr *V;
     const Expr *X;
-    const Expr *Expr;
+    // Listed as 'expr' in the standard, this is typically a generic expression
+    // as a component.
+    const Expr *RefExpr;
     // TODO: OpenACC: We should expand this as we're implementing the other
     // atomic construct kinds.
   };
diff --git a/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp b/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp
index b125330321afd..349b111c0d8fd 100644
--- a/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp
@@ -346,7 +346,7 @@ CIRGenFunction::emitOpenACCAtomicConstruct(const OpenACCAtomicConstruct &s) {
   }
   case OpenACCAtomicKind::Write: {
     mlir::Value x = emitLValue(inf.X).getPointer();
-    mlir::Value expr = emitAnyExpr(inf.Expr).getValue();
+    mlir::Value expr = emitAnyExpr(inf.RefExpr).getValue();
     auto op = mlir::acc::AtomicWriteOp::create(builder, start, x, expr,
                                                /*ifCond=*/{});
     emitOpenACCClauses(op, s.getDirectiveKind(), s.getDirectiveLoc(),

Copy link
Contributor

@cor3ntin cor3ntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SubExpr would also work

@erichkeane erichkeane merged commit 536bd72 into llvm:main Oct 23, 2025
13 of 14 checks passed
dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
I used 'expr' since that is what it is in the standard, but that
obviously conflicts with our warnings on some build bots. This patch
fixes that by renaming it.
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
I used 'expr' since that is what it is in the standard, but that
obviously conflicts with our warnings on some build bots. This patch
fixes that by renaming it.
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
I used 'expr' since that is what it is in the standard, but that
obviously conflicts with our warnings on some build bots. This patch
fixes that by renaming it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants