================
@@ -82,6 +83,14 @@ void 
CIRGenModule::emitGlobalFunctionDefinition(clang::GlobalDecl gd,
   theModule.push_back(funcOp);
 }
 
+void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *vd,
+                                           bool isTentative) {
+  mlir::Type type = getTypes().convertType(vd->getType());
+  auto varOp = builder.create<cir::GlobalOp>(
+      getLoc(vd->getSourceRange()), vd->getIdentifier()->getName(), type);
----------------
erichkeane wrote:

`getIdentifier` could potentially result in a nullptr if this is a 'special' 
name (or with some other magic? I know it is possible for local variables).  So 
an assert/fallback for `getIdentifier==nullptr` would be appreciated here.

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

Reply via email to