================
@@ -797,6 +797,22 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName,
mlir::Type ty,
"external const declaration with initializer");
}
+ // TODO(cir): if this method is used to handle functions we must have
+ // something closer to GlobalValue::isDeclaration instead of checking for
+ // initializer.
+ if (gv.isDeclaration()) {
----------------
andykaylor wrote:
Classic codegen is doing this here:
```
if (D &&
D->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly) {
```
Is there a reason we shouldn't do that instead of calling `gv.isDeclaration()`?
https://github.com/llvm/llvm-project/pull/184248
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits