From f1177988ba059e0154bd698a708fb71e8e2be603 Mon Sep 17 00:00:00 2001 From: Kritoooo Date: Thu, 13 Jun 2024 16:37:51 +0800 Subject: [PATCH] fix funcOp --- clang/lib/CIR/Lowering/ThroughMLIR/LowerCIRToMLIR.cpp | 4 ++-- clang/test/CIR/Lowering/ThroughMLIR/dot.cir | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/CIR/Lowering/ThroughMLIR/LowerCIRToMLIR.cpp b/clang/lib/CIR/Lowering/ThroughMLIR/LowerCIRToMLIR.cpp index f631037ebe63..3afe7774b1a0 100644 --- a/clang/lib/CIR/Lowering/ThroughMLIR/LowerCIRToMLIR.cpp +++ b/clang/lib/CIR/Lowering/ThroughMLIR/LowerCIRToMLIR.cpp @@ -558,10 +558,10 @@ class CIRFuncOpLowering : public mlir::OpConversionPattern { resultType ? mlir::TypeRange(resultType) : mlir::TypeRange())); - rewriter.inlineRegionBefore(op.getBody(), fn.getBody(), fn.end()); - if (failed(rewriter.convertRegionTypes(&fn.getBody(), *typeConverter, + if (failed(rewriter.convertRegionTypes(&op.getBody(), *typeConverter, &signatureConversion))) return mlir::failure(); + rewriter.inlineRegionBefore(op.getBody(), fn.getBody(), fn.end()); rewriter.eraseOp(op); return mlir::LogicalResult::success(); diff --git a/clang/test/CIR/Lowering/ThroughMLIR/dot.cir b/clang/test/CIR/Lowering/ThroughMLIR/dot.cir index 27ab0e9c33f6..5fc5311a65a9 100644 --- a/clang/test/CIR/Lowering/ThroughMLIR/dot.cir +++ b/clang/test/CIR/Lowering/ThroughMLIR/dot.cir @@ -1,6 +1,5 @@ // RUN: cir-opt %s -cir-to-mlir -o %t.mlir // RUN: FileCheck --input-file=%t.mlir %s -// XFAIL: * !s32i = !cir.int module {