diff --git a/flang/unittests/Optimizer/Builder/CharacterTest.cpp b/flang/unittests/Optimizer/Builder/CharacterTest.cpp --- a/flang/unittests/Optimizer/Builder/CharacterTest.cpp +++ b/flang/unittests/Optimizer/Builder/CharacterTest.cpp @@ -16,7 +16,7 @@ struct CharacterTest : public testing::Test { public: void SetUp() override { - fir::KindMapping kindMap(&context, + kindMap = std::make_unique(&context, "i10:80,l3:24,a1:8,r54:Double,c20:X86_FP80,r11:PPC_FP128," "r12:FP128,r13:X86_FP80,r14:Double,r15:Float,r16:Half,r23:BFloat"); mlir::OpBuilder builder(&context); @@ -32,12 +32,13 @@ builder.setInsertionPointToStart(entryBlock); fir::support::loadDialects(context); - firBuilder = std::make_unique(mod, kindMap); + firBuilder = std::make_unique(mod, *kindMap); } fir::FirOpBuilder &getBuilder() { return *firBuilder; } mlir::MLIRContext context; + std::unique_ptr kindMap; std::unique_ptr firBuilder; }; diff --git a/flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp b/flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp --- a/flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp +++ b/flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp @@ -15,9 +15,9 @@ struct DoLoopHelperTest : public testing::Test { public: void SetUp() { - fir::KindMapping kindMap(&context); + kindMap = std::make_unique(&context); mlir::OpBuilder builder(&context); - firBuilder = new fir::FirOpBuilder(builder, kindMap); + firBuilder = new fir::FirOpBuilder(builder, *kindMap); fir::support::loadDialects(context); } void TearDown() { delete firBuilder; } @@ -25,6 +25,7 @@ fir::FirOpBuilder &getBuilder() { return *firBuilder; } mlir::MLIRContext context; + std::unique_ptr kindMap; fir::FirOpBuilder *firBuilder; };