[llvm] 4a5d0d8 - [Attributor][FIX] Avoid memory leakage through InstExclusionSet
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 13 22:58:47 PST 2022
Author: Johannes Doerfert
Date: 2022-12-13T22:58:34-08:00
New Revision: 4a5d0d8704aa2860c0459a63adfdd415a451c4f1
URL: https://github.com/llvm/llvm-project/commit/4a5d0d8704aa2860c0459a63adfdd415a451c4f1
DIFF: https://github.com/llvm/llvm-project/commit/4a5d0d8704aa2860c0459a63adfdd415a451c4f1.diff
LOG: [Attributor][FIX] Avoid memory leakage through InstExclusionSet
Added:
Modified:
llvm/include/llvm/Transforms/IPO/Attributor.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 3d622fd434b9..f7c430065fb4 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -1142,6 +1142,10 @@ struct InformationCache {
// the destructor manually.
for (auto &It : FuncInfoMap)
It.getSecond()->~FunctionInfo();
+ // Same is true for the instruction exclusions sets.
+ using AA::InstExclusionSetTy;
+ for (auto *BES : BESets)
+ BES->~InstExclusionSetTy();
}
/// Apply \p CB to all uses of \p F. If \p LookThroughConstantExprUses is
@@ -1338,7 +1342,7 @@ struct InformationCache {
SetVector<const Instruction *> AssumeOnlyValues;
/// Cache for block sets to allow reuse.
- DenseSet<const AA::InstExclusionSetTy *> BESets;
+ DenseSet<AA::InstExclusionSetTy *> BESets;
/// Getters for analysis.
AnalysisGetter &AG;
More information about the llvm-commits
mailing list