diff --git a/mlir/include/mlir/Support/LLVM.h b/mlir/include/mlir/Support/LLVM.h --- a/mlir/include/mlir/Support/LLVM.h +++ b/mlir/include/mlir/Support/LLVM.h @@ -96,12 +96,14 @@ namespace mlir { // Casting operators. using llvm::cast; +using llvm::cast_if_present; using llvm::cast_or_null; using llvm::dyn_cast; using llvm::dyn_cast_if_present; using llvm::dyn_cast_or_null; using llvm::isa; using llvm::isa_and_nonnull; +using llvm::isa_and_present; // String types using llvm::SmallString; diff --git a/mlir/unittests/IR/TypeTest.cpp b/mlir/unittests/IR/TypeTest.cpp --- a/mlir/unittests/IR/TypeTest.cpp +++ b/mlir/unittests/IR/TypeTest.cpp @@ -50,7 +50,7 @@ EXPECT_TRUE(isa(intTy)); EXPECT_FALSE(isa(intTy)); - EXPECT_FALSE(llvm::isa_and_present(nullTy)); + EXPECT_FALSE(isa_and_present(nullTy)); EXPECT_TRUE(isa(middleTy)); EXPECT_FALSE(isa(middleTy)); EXPECT_TRUE(isa(leafTy)); @@ -59,9 +59,8 @@ EXPECT_TRUE(static_cast(dyn_cast(intTy))); EXPECT_FALSE(static_cast(dyn_cast(intTy))); - EXPECT_FALSE(static_cast(llvm::cast_if_present(nullTy))); - EXPECT_FALSE( - static_cast(llvm::dyn_cast_if_present(nullTy))); + EXPECT_FALSE(static_cast(cast_if_present(nullTy))); + EXPECT_FALSE(static_cast(dyn_cast_if_present(nullTy))); EXPECT_EQ(8u, cast(intTy).getWidth()); }