================
@@ -420,6 +415,11 @@ static mlir::TypedAttr lowerInitialValue(const LowerModule 
*lowerModule,
   if (mlir::isa_and_present<cir::PoisonAttr>(initVal))
     return cir::PoisonAttr::get(tc.convertType(ty));
 
+  // An external member-pointer global may have no initializer.
+  if (!initVal &&
+      mlir::isa<cir::DataMemberType, cir::MethodType>(ty))
+    return {};
----------------
andykaylor wrote:

```suggestion
  // An external global may have no initializer.
  if (!initVal)
    return {};
```
There's no reason for this to be specific to member pointers. This could be 
hoisted above the UndefAttr check.

https://github.com/llvm/llvm-project/pull/235267
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to