File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1903,15 +1903,13 @@ void LifetimeCheckPass::checkOperation(Operation *op) {
19031903}
19041904
19051905void LifetimeCheckPass::runOnOperation () {
1906+ assert (astCtx && " Missing ASTContext, please construct with the right ctor" );
19061907 opts.parseOptions (*this );
19071908 Operation *op = getOperation ();
19081909 checkOperation (op);
19091910}
19101911
19111912std::unique_ptr<Pass> mlir::createLifetimeCheckPass () {
1912- // FIXME: MLIR requres a default "constructor", but should never
1913- // be used.
1914- llvm_unreachable (" Check requires clang::ASTContext, use the other ctor" );
19151913 return std::make_unique<LifetimeCheckPass>();
19161914}
19171915
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ set(deps)
1717if (CLANG_ENABLE_CIR)
1818 list (APPEND link_libs
1919 clangCIRFrontendAction
20+ MLIRCIRTransforms
2021 MLIRIR
2122 MLIRPass
2223 )
Original file line number Diff line number Diff line change 3636#include " mlir/IR/AsmState.h"
3737#include " mlir/IR/MLIRContext.h"
3838#include " mlir/Pass/PassManager.h"
39+ #include " clang/CIR/Dialect/Passes.h"
3940#include " clang/CIRFrontendAction/CIRGenAction.h"
4041#endif
4142
@@ -317,6 +318,7 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
317318#endif
318319#if CLANG_ENABLE_CIR
319320 if (!Clang->getFrontendOpts ().MLIRArgs .empty ()) {
321+ mlir::registerCIRPasses ();
320322 mlir::registerMLIRContextCLOptions ();
321323 mlir::registerPassManagerCLOptions ();
322324 mlir::registerAsmPrinterCLOptions ();
Original file line number Diff line number Diff line change 11// RUN: %clang_cc1 -fclangir-enable -emit-cir -mmlir --mlir-print-ir-after-all %s -o %t.cir 2>&1 | FileCheck %s -check-prefix=CIR
22// RUN: %clang_cc1 -fclangir-enable -emit-llvm -mmlir --mlir-print-ir-after-all -mllvm -print-after-all %s -o %t.ll 2>&1 | FileCheck %s -check-prefix=CIR -check-prefix=LLVM
3+ // RUN: %clang_cc1 -fclangir-enable -emit-cir -mmlir --mlir-print-ir-after=cir-drop-ast %s -o %t.cir 2>&1 | FileCheck %s -check-prefix=CIRPASS
34
45int foo (void ) {
56 int i = 3 ;
@@ -15,3 +16,6 @@ int foo(void) {
1516// LLVM: llvm.func @foo() -> i32
1617// LLVM: IR Dump After
1718// LLVM: define i32 @foo()
19+
20+ // CIRPASS-NOT: IR Dump After MergeCleanups
21+ // CIRPASS: IR Dump After DropAST
You can’t perform that action at this time.
0 commit comments