[clang] [CIR] Refactor global variable emission and initialization (PR #138222)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu May 1 19:21:12 PDT 2025
================
@@ -324,8 +358,16 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName, mlir::Type ty,
return entry;
}
- errorNYI(d->getSourceRange(), "reference of undeclared global");
- return {};
+ mlir::Location loc = getLoc(d->getSourceRange());
+
+ // mlir::SymbolTable::Visibility::Public is the default, no need to explicitly
+ // mark it as such.
+ cir::GlobalOp gv =
+ CIRGenModule::createGlobalOp(*this, loc, mangledName, ty,
+ /*insertPoint=*/entry.getOperation());
+
+ // errorNYI(d->getSourceRange(), "reference of undeclared global");
----------------
erichkeane wrote:
Oh?
https://github.com/llvm/llvm-project/pull/138222
More information about the cfe-commits
mailing list