[clang] [CIR] Emit references to constant-initialized const variables as const. (PR #231689)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 15 10:53:15 PDT 2026


================
@@ -3055,47 +3056,139 @@ Address CIRGenFunction::createDefaultAlignTempAlloca(mlir::Type ty,
   return createTempAlloca(ty, align, loc, name);
 }
 
+/// Given an object of the given canonical type, can we safely copy a
+/// value out of it based on its initializer?
+static bool isConstantEmittableObjectType(QualType type) {
----------------
andykaylor wrote:

Can this be shared with classic codegen somehow? Maybe move it into QualType?

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


More information about the cfe-commits mailing list