================
@@ -1318,6 +1318,19 @@ cir::GlobalOp 
CIRGenModule::getGlobalForStringLiteral(const StringLiteral *s,
   return gv;
 }
 
+/// Return a pointer to a constant array for the given string literal.
+cir::GlobalViewAttr
+CIRGenModule::getAddrOfConstantStringFromLiteral(const StringLiteral *s,
+                                                 StringRef name) {
+  cir::GlobalOp gv = getGlobalForStringLiteral(s, name);
+  auto arrayTy = mlir::dyn_cast<cir::ArrayType>(gv.getSymType());
+  assert(arrayTy && "String literal must be array");
----------------
andykaylor wrote:

```suggestion
  auto arrayTy = mlir::cast<cir::ArrayType>(gv.getSymType());
```

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

Reply via email to