================ @@ -26,6 +26,34 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { CIRGenBuilderTy(mlir::MLIRContext &mlirContext, const CIRGenTypeCache &tc) : CIRBaseBuilderTy(mlirContext), typeCache(tc) {} + /// Get a cir::ConstArrayAttr for a string literal. + /// Note: This is different from what is returned by + /// mlir::Builder::getStringAttr() which is an mlir::StringAttr. + mlir::Attribute getString(llvm::StringRef str, mlir::Type eltTy, + unsigned size) { + unsigned finalSize = size ? size : str.size(); ---------------- erichkeane wrote:
instead of 0 being special, can we make `size` be an `optional`? https://github.com/llvm/llvm-project/pull/140796 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits