OSDN Git Service

[PhiValues] Use callback value handles to invalidate deleted values
authorJohn Brawn <john.brawn@arm.com>
Fri, 24 Aug 2018 15:48:30 +0000 (15:48 +0000)
committerJohn Brawn <john.brawn@arm.com>
Fri, 24 Aug 2018 15:48:30 +0000 (15:48 +0000)
commitd73e0d8056df386d0fbc7cadd783cf96e652267e
tree315d868539e650fec75cb1d5fb57faca3c2f55c0
parentff323c38f1395151b4717c1f49535bcf7b3aa136
[PhiValues] Use callback value handles to invalidate deleted values

The way that PhiValues is integrated with BasicAA it is possible for a pass
which uses BasicAA to pick up an instance of BasicAA that uses PhiValues without
intending to, and then delete values from a function in a way that causes
PhiValues to return dangling pointers to these deleted values. Fix this by
having a set of callback value handles to invalidate values when they're
deleted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340613 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/PhiValues.h
lib/Analysis/PhiValues.cpp
test/Analysis/BasicAA/phi-values-usage.ll