================
@@ -898,16 +898,21 @@ populateCXXABIConversionTarget(mlir::ConversionTarget
&target,
void CXXABILoweringPass::runOnOperation() {
auto mod = mlir::cast<mlir::ModuleOp>(getOperation());
+ // Triple attribute is required by createLowerModule:
+ if (!mod->hasAttr(cir::CIRDialect::getTripleAttrName())) {
+ mod.emitError() << getArgument() << " requires a module with a '"
+ << cir::CIRDialect::getTripleAttrName() << "' attribute";
+ return signalPassFailure();
+ }
+
mlir::MLIRContext *ctx = mod.getContext();
std::unique_ptr<cir::LowerModule> lowerModule = cir::createLowerModule(mod);
- // If lower module is not available, skip the ABI lowering pass.
if (!lowerModule) {
----------------
ianayl wrote:
Done, let me know if more changes are necessary. Thanks for the review once
again!
https://github.com/llvm/llvm-project/pull/230003
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits