================
@@ -257,6 +258,21 @@ cir::CIRDialect::verifyOperationAttribute(mlir::Operation
*op,
if (isOpenCLVersionAttrName(attrName))
return verifyOpenCLVersionAttr(op, attr);
+ if (attrName == getCXXABIAttrName()) {
+ if (!mlir::isa<mlir::ModuleOp>(op))
+ return op->emitOpError() << "expects '" << getCXXABIAttrName()
+ << "' attribute to be attached to '"
+ << mlir::ModuleOp::getOperationName() << "'";
+ auto abi = mlir::dyn_cast<mlir::StringAttr>(attr.getValue());
+ if (!abi)
+ return op->emitOpError()
+ << "expects '" << getCXXABIAttrName() << "' to be a string";
+
+ if (!clang::TargetCXXABI::isABI(abi.getValue()))
+ return op->emitOpError() << "unknown C++ ABI '" << abi.getValue() << "'";
+ return success();
+ }
+
----------------
Fznamznon wrote:
Ok, added new verification in 40533b33fb2f7358d032dd141cb971d6321c76d2 . I'm
concerned though that this will need updates once more ABIs are supported by
CIR.
https://github.com/llvm/llvm-project/pull/229494
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits