Skip to content

Commit bc13a66

Browse files
author
git apple-llvm automerger
committed
Merge commit '616e5230c7e3' from llvm.org/main into next
2 parents 774f96a + 616e523 commit bc13a66

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class FunctionPropertiesAnalysisTest : public testing::Test {
4646
MAM.registerPass([VocabVector = std::move(VocabVector)]() mutable {
4747
return IR2VecVocabAnalysis(std::move(VocabVector));
4848
});
49-
IR2VecVocab =
50-
new ir2vec::Vocabulary(ir2vec::Vocabulary::createDummyVocabForTest(1));
49+
IR2VecVocab = std::make_unique<ir2vec::Vocabulary>(
50+
ir2vec::Vocabulary::createDummyVocabForTest(1));
5151
MAM.registerPass([&] { return PassInstrumentationAnalysis(); });
5252
FAM.registerPass([&] { return ModuleAnalysisManagerFunctionProxy(MAM); });
5353
FAM.registerPass([&] { return DominatorTreeAnalysis(); });
@@ -69,7 +69,7 @@ class FunctionPropertiesAnalysisTest : public testing::Test {
6969
std::unique_ptr<LoopInfo> LI;
7070
FunctionAnalysisManager FAM;
7171
ModuleAnalysisManager MAM;
72-
ir2vec::Vocabulary *IR2VecVocab;
72+
std::unique_ptr<ir2vec::Vocabulary> IR2VecVocab;
7373

7474
void TearDown() override {
7575
// Restore original IR2Vec weights

llvm/unittests/Analysis/IR2VecTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ TEST(IR2VecTest, ZeroDimensionEmbedding) {
295295
// Fixture for IR2Vec tests requiring IR setup.
296296
class IR2VecTestFixture : public ::testing::Test {
297297
protected:
298-
Vocabulary *V;
298+
std::unique_ptr<Vocabulary> V;
299299
LLVMContext Ctx;
300300
std::unique_ptr<Module> M;
301301
Function *F = nullptr;
@@ -304,7 +304,7 @@ class IR2VecTestFixture : public ::testing::Test {
304304
Instruction *RetInst = nullptr;
305305

306306
void SetUp() override {
307-
V = new Vocabulary(Vocabulary::createDummyVocabForTest(2));
307+
V = std::make_unique<Vocabulary>(Vocabulary::createDummyVocabForTest(2));
308308

309309
// Setup IR
310310
M = std::make_unique<Module>("TestM", Ctx);

0 commit comments

Comments
 (0)