summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/AliasSetTracker.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-29 18:42:23 +0000
committerChris Lattner <sabre@nondot.org>2010-08-29 18:42:23 +0000
commitcb7f65342291caa3636cb50c0ee04b383cd79f8d (patch)
tree22dc8165df04b3500e6eb4b2120d082e9bd79957 /include/llvm/Analysis/AliasSetTracker.h
parent0de5cad74d8d2987b92b8d76af3f1eab988b3c7b (diff)
downloadllvm-cb7f65342291caa3636cb50c0ee04b383cd79f8d.tar.gz
llvm-cb7f65342291caa3636cb50c0ee04b383cd79f8d.tar.bz2
llvm-cb7f65342291caa3636cb50c0ee04b383cd79f8d.tar.xz
two changes: 1) make AliasSet hold the list of call sites with an
assertingvh so we get a violent explosion if the pointer dangles. 2) Fix AliasSetTracker::deleteValue to remove call sites with by-pointer comparisons instead of by-alias queries. Using findAliasSetForCallSite can cause alias sets to get merged when they shouldn't, and can also miss alias sets when the call is readonly. #2 fixes PR6889, which only repros with a .c file :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/AliasSetTracker.h')
-rw-r--r--include/llvm/Analysis/AliasSetTracker.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h
index 09f12ad281..8e2f7fd29a 100644
--- a/include/llvm/Analysis/AliasSetTracker.h
+++ b/include/llvm/Analysis/AliasSetTracker.h
@@ -92,7 +92,8 @@ class AliasSet : public ilist_node<AliasSet> {
AliasSet *Forward; // Forwarding pointer.
AliasSet *Next, *Prev; // Doubly linked list of AliasSets.
- std::vector<CallSite> CallSites; // All calls & invokes in this alias set.
+ // All calls & invokes in this alias set.
+ std::vector<AssertingVH<Instruction> > CallSites;
// RefCount - Number of nodes pointing to this AliasSet plus the number of
// AliasSets forwarding to it.
@@ -127,6 +128,11 @@ class AliasSet : public ilist_node<AliasSet> {
removeFromTracker(AST);
}
+ CallSite getCallSite(unsigned i) const {
+ assert(i < CallSites.size());
+ return CallSite(CallSites[i]);
+ }
+
public:
/// Accessors...
bool isRef() const { return AccessTy & Refs; }
@@ -229,7 +235,7 @@ private:
void addCallSite(CallSite CS, AliasAnalysis &AA);
void removeCallSite(CallSite CS) {
for (size_t i = 0, e = CallSites.size(); i != e; ++i)
- if (CallSites[i].getInstruction() == CS.getInstruction()) {
+ if (CallSites[i] == CS.getInstruction()) {
CallSites[i] = CallSites.back();
CallSites.pop_back();
}