@@ -105,25 +105,25 @@ void Lifetime::setupAndRunClangIRLifetimeChecker(ASTContext &astCtx) {
105
105
106
106
clang::SourceLocation getClangSrcLoc (mlir::Location loc) {
107
107
// Direct maps into a clang::SourceLocation.
108
- if (auto fileLoc = loc. dyn_cast <mlir::FileLineColLoc>()) {
108
+ if (auto fileLoc = dyn_cast<mlir::FileLineColLoc>(loc )) {
109
109
return getClangFromFileLineCol (fileLoc);
110
110
}
111
111
112
112
// FusedLoc needs to be decomposed but the canonical one
113
113
// is the first location, we handle source ranges somewhere
114
114
// else.
115
- if (auto fileLoc = loc. dyn_cast <mlir::FusedLoc>()) {
115
+ if (auto fileLoc = dyn_cast<mlir::FusedLoc>(loc )) {
116
116
auto locArray = fileLoc.getLocations ();
117
117
assert (locArray.size () > 0 && " expected multiple locs" );
118
118
return getClangFromFileLineCol (
119
- locArray[ 0 ]. dyn_cast <mlir::FileLineColLoc>());
119
+ dyn_cast<mlir::FileLineColLoc>(locArray[ 0 ] ));
120
120
}
121
121
122
122
// Many loc styles are yet to be handled.
123
- if (auto fileLoc = loc. dyn_cast <mlir::UnknownLoc>()) {
123
+ if (auto fileLoc = dyn_cast<mlir::UnknownLoc>(loc )) {
124
124
llvm_unreachable (" mlir::UnknownLoc not implemented!" );
125
125
}
126
- if (auto fileLoc = loc. dyn_cast <mlir::CallSiteLoc>()) {
126
+ if (auto fileLoc = dyn_cast<mlir::CallSiteLoc>(loc )) {
127
127
llvm_unreachable (" mlir::CallSiteLoc not implemented!" );
128
128
}
129
129
llvm_unreachable (" Unknown location style" );
@@ -178,7 +178,7 @@ void Lifetime::setupAndRunClangIRLifetimeChecker(ASTContext &astCtx) {
178
178
mlir::PassManager pm (mlirCtx.get());
179
179
180
180
// Add pre-requisite passes to the pipeline
181
- pm.addPass(mlir::createMergeCleanupsPass ());
181
+ pm.addPass(mlir::createCIRSimplifyPass ());
182
182
183
183
// Insert the lifetime checker.
184
184
pm.addPass(mlir::createLifetimeCheckPass(
0 commit comments