https://github.com/Men-cotton created 
https://github.com/llvm/llvm-project/pull/205512

Match the `VarDecl::evaluateValue()` contract updated by #205033 in CIR 
constant emission.

>From a2167b21cbf346b1bd1ad63ebef34c9a1ed655c3 Mon Sep 17 00:00:00 2001
From: mencotton <[email protected]>
Date: Wed, 24 Jun 2026 17:42:41 +0900
Subject: [PATCH] [CIR] Handle const evaluated variable values

Match the `VarDecl::evaluateValue()` contract updated by #205033 in CIR 
constant emission.
---
 clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp 
b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
index 6c64d7571795a..c29b66ac2f8bc 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
@@ -1725,7 +1725,7 @@ mlir::Attribute 
ConstantEmitter::tryEmitPrivateForVarInit(const VarDecl &d) {
 
   // Try to emit the initializer.  Note that this can allow some things that
   // are not allowed by tryEmitPrivateForMemory alone.
-  if (APValue *value = d.evaluateValue())
+  if (const APValue *value = d.evaluateValue())
     return tryEmitPrivateForMemory(*value, destType);
 
   return {};

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to