[clang] [CIR] Support for static variables (PR #143980)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 12 15:20:39 PDT 2025


================
@@ -185,11 +185,23 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
                                     global.getSymName());
   }
 
+  mlir::Value createGetGlobal(cir::GlobalOp global) {
+    return createGetGlobal(global.getLoc(), global);
+  }
+
   cir::StoreOp createStore(mlir::Location loc, mlir::Value val, mlir::Value dst,
                            mlir::IntegerAttr align = {}) {
     return create<cir::StoreOp>(loc, val, dst, align);
   }
 
+  [[nodiscard]] cir::GlobalOp
+  createGlobal(mlir::ModuleOp module, mlir::Location loc, mlir::StringRef name,
----------------
erichkeane wrote:

don't use `module`!  I realize it is a contextual keyword, but some parsers are going to get grumpy at this (like githubs!).

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


More information about the cfe-commits mailing list