diff options
author | Johannes Doerfert <johannes@jdoerfert.de> | 2022-12-13 22:57:55 -0800 |
---|---|---|
committer | Johannes Doerfert <johannes@jdoerfert.de> | 2022-12-13 22:58:34 -0800 |
commit | 4a5d0d8704aa2860c0459a63adfdd415a451c4f1 (patch) | |
tree | fb5f37ac2da09074dfbd1922686d51425e6d0f0c /llvm | |
parent | 07c375348083170e39c9498a42a9679c7e08f07f (diff) | |
download | llvm-4a5d0d8704aa2860c0459a63adfdd415a451c4f1.zip llvm-4a5d0d8704aa2860c0459a63adfdd415a451c4f1.tar.gz llvm-4a5d0d8704aa2860c0459a63adfdd415a451c4f1.tar.bz2 |
[Attributor][FIX] Avoid memory leakage through InstExclusionSet
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Transforms/IPO/Attributor.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h index 3d622fd..f7c4300 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 @@ private: 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; |