diff options
author | Maksim Levental <maksim.levental@gmail.com> | 2025-07-24 18:05:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-24 19:05:25 -0400 |
commit | 3f74334c38120bbdefac012d478dfce8e4eb0906 (patch) | |
tree | 7ac32117aacfcb6556c95b3bf139f70f7121ac46 /flang/unittests/Frontend/CodeGenActionTest.cpp | |
parent | 77524bcf263d80b2e87a5c9c19f7e5f9fa1cd257 (diff) | |
download | llvm-3f74334c38120bbdefac012d478dfce8e4eb0906.zip llvm-3f74334c38120bbdefac012d478dfce8e4eb0906.tar.gz llvm-3f74334c38120bbdefac012d478dfce8e4eb0906.tar.bz2 |
[mlir][NFC] update `flang` create APIs (13/n) (#149913)
See https://github.com/llvm/llvm-project/pull/147168 for more info.
Diffstat (limited to 'flang/unittests/Frontend/CodeGenActionTest.cpp')
-rw-r--r-- | flang/unittests/Frontend/CodeGenActionTest.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/flang/unittests/Frontend/CodeGenActionTest.cpp b/flang/unittests/Frontend/CodeGenActionTest.cpp index 6020abc..e606456 100644 --- a/flang/unittests/Frontend/CodeGenActionTest.cpp +++ b/flang/unittests/Frontend/CodeGenActionTest.cpp @@ -50,6 +50,15 @@ public: static void build( ::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {} + + static FakeOp create( + ::mlir::OpBuilder &odsBuilder, ::mlir::Location location) { + ::mlir::OperationState state(location, getOperationName()); + build(odsBuilder, state); + auto res = ::llvm::dyn_cast<FakeOp>(odsBuilder.create(state)); + assert(res && "builder didn't return the right type"); + return res; + } }; } // namespace dummy } // namespace test @@ -77,7 +86,7 @@ public: mlir::OpBuilder builder(mlirCtx.get()); builder.setInsertionPointToStart(&mlirModule->getRegion().front()); // Create a fake op to trip conversion to LLVM. - builder.create<test::dummy::FakeOp>(loc); + test::dummy::FakeOp::create(builder, loc); llvmCtx = std::make_unique<llvm::LLVMContext>(); } |