================
@@ -464,6 +464,21 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
return cir::ConstantOp::create(*this, loc, cir::ZeroAttr::get(ty));
}
+
//===--------------------------------------------------------------------===//
+ // Metadata creation helpers
+
//===--------------------------------------------------------------------===//
+ cir::MDStringAttr getMDStringAttr(llvm::StringRef str) {
+ return cir::MDStringAttr::get(getContext(), getStringAttr(str));
+ }
+
+ cir::MDNodeAttr getMDNodeAttr(llvm::ArrayRef<mlir::Attribute> operands) {
+ return cir::MDNodeAttr::get(getContext(), operands);
+ }
+
+ mlir::Value createMetadataAsValue(mlir::Location loc, mlir::Attribute md) {
+ return cir::MetadataAsValueOp::create(*this, loc, md);
----------------
ranapratap55 wrote:
This omits the result type, but the other cir::MetadataAsValueOp::create() in
CIRDialect.cpp passes it explicitly.
Could you confirm generated .inc for a MetadataAsValueOp::build overload that
omits the result type?
https://github.com/llvm/llvm-project/pull/204190
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits