diff options
| author | Michael Zolotukhin <mzolotukhin@apple.com> | 2018-06-21 05:14:00 +0000 |
|---|---|---|
| committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2018-06-21 05:14:00 +0000 |
| commit | 336d75cc73ee268d9b4d08b585a5532c3eb54f73 (patch) | |
| tree | 3538f5d78ad5e4aaadcadba01b90530c162e25b2 /llvm/lib | |
| parent | 2da60bc231859b846d3cbcb0681c2cb6510f8187 (diff) | |
| download | bcm5719-llvm-336d75cc73ee268d9b4d08b585a5532c3eb54f73.tar.gz bcm5719-llvm-336d75cc73ee268d9b4d08b585a5532c3eb54f73.zip | |
ProvenanceAnalysis: Store WeakTrackingVH instead of Value* in UnderlyingValue Cache.
Summary:
Since the value stored in the cache might be deleted or replaced with
something else, we need to use tracking ValueHandlers instead of plain
Value pointers. It was discovered in one of internal builds, and
unfortunately there is no small reproducer for the issue.
The cache was introduced in rL327328.
Reviewers: ahatanak, pete
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D48407
llvm-svn: 335201
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h b/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h index 8a2e16e65fb..1276f564a02 100644 --- a/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h +++ b/llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.h @@ -28,6 +28,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/IR/ValueHandle.h" #include <utility> namespace llvm { @@ -56,7 +57,7 @@ class ProvenanceAnalysis { CachedResultsTy CachedResults; - DenseMap<const Value *, const Value *> UnderlyingObjCPtrCache; + DenseMap<const Value *, WeakTrackingVH> UnderlyingObjCPtrCache; bool relatedCheck(const Value *A, const Value *B, const DataLayout &DL); bool relatedSelect(const SelectInst *A, const Value *B); |

