aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
diff options
context:
space:
mode:
authorS. VenkataKeerthy <31350914+svkeerthy@users.noreply.github.com>2025-10-03 10:51:15 -0700
committerGitHub <noreply@github.com>2025-10-03 10:51:15 -0700
commit616e5230c7e31caae2c58b46c9655a3617a437a3 (patch)
treee26eef80457aa0ef3ad6dd4ae628f70a535172b9 /llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
parent2e67f5ceb8585983e1ca64e776bcbdb86b27c61f (diff)
downloadllvm-616e5230c7e31caae2c58b46c9655a3617a437a3.zip
llvm-616e5230c7e31caae2c58b46c9655a3617a437a3.tar.gz
llvm-616e5230c7e31caae2c58b46c9655a3617a437a3.tar.bz2
Fixing memory leaks in tests (#161878)
Fixing the memory leaks introduced (#158376) in the unit tests of FunctionPropertiesAnalysis and IR2Vec.
Diffstat (limited to 'llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp')
-rw-r--r--llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp b/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
index b6e8567..497da8f 100644
--- a/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
+++ b/llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp
@@ -46,8 +46,8 @@ public:
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(); });
@@ -69,7 +69,7 @@ protected:
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