================
@@ -1063,8 +1063,13 @@ static mlir::Attribute getNewInitValue(CIRGenModule
&cgm, cir::GlobalOp newGlob,
};
if (auto oldArray = mlir::dyn_cast<cir::ConstArrayAttr>(oldInit)) {
- mlir::Attribute newElements =
- getNewInitElements(mlir::cast<mlir::ArrayAttr>(oldArray.getElts()));
+ // A ConstArrayAttr backed by a StringAttr (a string-literal initializer)
----------------
erichkeane wrote:
This comment seems very incomplete, and this fix does as well. Why would any
non-array-attr be fine here? Are there any other cases we need to consider?
In fact, the example seems to be cir::ArrayAttr (vs an mlir::ArrayAttr) which
could contain basically anything, and could very well contain global
references, right? So I think we actually DO need to handle those as well.
https://github.com/llvm/llvm-project/pull/206538
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits