================
@@ -839,14 +841,15 @@ mlir::Attribute ConstantLValueEmitter::tryEmit() {
 
   // Convert to the appropriate type; this could be an lvalue for
   // an integer. FIXME: performAddrSpaceCast
-  if (mlir::isa<cir::PointerType>(destTy)) {
-    if (auto attr = mlir::dyn_cast<mlir::Attribute>(value))
+  if (auto attr = mlir::dyn_cast<mlir::Attribute>(value)) {
+    if (auto gv = mlir::dyn_cast<cir::GlobalViewAttr>(attr))
----------------
xakep8 wrote:

It might not be of the correct type and can be pointer-typed but later it is 
retagged in the line below after the offset adjustment to the destination type. 
Also the global view flows from the tryEmitBase and we simply retag it to the 
destination type.

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

Reply via email to