================
@@ -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");
----------------
andykaylor wrote:

Yeah, I'm not sure how I left that. I had put this aside in the middle of 
creating the PR, so I think maybe I wanted to take another look at what the 
incubator does after this. There is a bit more code here, but nothing we're 
ready for yet. It handles deferred declarations from inline class members, and 
handles (or has NYI markers for) attributes based the info from the VarDecl. I 
think I was pausing here to test whether I had enough for it to work as it is, 
and it appears I do.

https://github.com/llvm/llvm-project/pull/138222
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to