summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-04 22:23:21 +0000
committerChris Lattner <sabre@nondot.org>2005-04-04 22:23:21 +0000
commit8a9763c3cd38cbca3a085b2d8a238199a3b5d919 (patch)
tree172bba4ff05dfab8cefce30b20420fb0f2fe58f1 /lib
parent7759adfb4d09cb7187c25026f4bcd2df0ff8ed60 (diff)
do not dereference an extra layer of pointers to determine if an external
call can modify a memory location. This fixes test/Regression/Analysis/Andersens/modreftest.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/IPA/Andersens.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index 146c88aaebd..2bfac755507 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/lib/Analysis/IPA/Andersens.cpp
@@ -374,19 +374,12 @@ Andersens::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
Node *N1 = getNode(P);
bool PointsToUniversalSet = false;
- for (Node::iterator NI = N1->begin(), E = N1->end(); NI != E; ++NI) {
- Node *PN = *NI;
- if (PN->begin() == PN->end())
- continue; // P doesn't point to anything.
- // Get the first pointee.
- Node *FirstPointee = *PN->begin();
- if (FirstPointee == &GraphNodes[UniversalSet]) {
- PointsToUniversalSet = true;
- break;
- }
- }
+ if (N1->begin() == N1->end())
+ return NoModRef; // P doesn't point to anything.
- if (!PointsToUniversalSet)
+ // Get the first pointee.
+ Node *FirstPointee = *N1->begin();
+ if (FirstPointee != &GraphNodes[UniversalSet])
return NoModRef; // P doesn't point to the universal set.
}