Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class FunctionPropertiesAnalysisTest : public testing::Test {
MAM.registerPass([VocabVector = std::move(VocabVector)]() mutable {
return IR2VecVocabAnalysis(std::move(VocabVector));
});
IR2VecVocab =
new ir2vec::Vocabulary(ir2vec::Vocabulary::createDummyVocabForTest(1));
IR2VecVocab = std::make_unique<ir2vec::Vocabulary>(
ir2vec::Vocabulary::createDummyVocabForTest(1));
MAM.registerPass([&] { return PassInstrumentationAnalysis(); });
FAM.registerPass([&] { return ModuleAnalysisManagerFunctionProxy(MAM); });
FAM.registerPass([&] { return DominatorTreeAnalysis(); });
Expand All @@ -69,7 +69,7 @@ class FunctionPropertiesAnalysisTest : public testing::Test {
std::unique_ptr<LoopInfo> LI;
FunctionAnalysisManager FAM;
ModuleAnalysisManager MAM;
ir2vec::Vocabulary *IR2VecVocab;
std::unique_ptr<ir2vec::Vocabulary> IR2VecVocab;

void TearDown() override {
// Restore original IR2Vec weights
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/Analysis/IR2VecTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ TEST(IR2VecTest, ZeroDimensionEmbedding) {
// Fixture for IR2Vec tests requiring IR setup.
class IR2VecTestFixture : public ::testing::Test {
protected:
Vocabulary *V;
std::unique_ptr<Vocabulary> V;
LLVMContext Ctx;
std::unique_ptr<Module> M;
Function *F = nullptr;
Expand All @@ -304,7 +304,7 @@ class IR2VecTestFixture : public ::testing::Test {
Instruction *RetInst = nullptr;

void SetUp() override {
V = new Vocabulary(Vocabulary::createDummyVocabForTest(2));
V = std::make_unique<Vocabulary>(Vocabulary::createDummyVocabForTest(2));

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