diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-12 23:12:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-12 23:12:55 +0000 |
commit | 7a82ba0510aece59f59fe988ab273c3542b4d559 (patch) | |
tree | 6668c036eb8f9f133c2f98795381722a97b2728d /lib | |
parent | 841714214ed276c9a69c471b6c85f6388e8db970 (diff) | |
download | external_llvm-7a82ba0510aece59f59fe988ab273c3542b4d559.zip external_llvm-7a82ba0510aece59f59fe988ab273c3542b4d559.tar.gz external_llvm-7a82ba0510aece59f59fe988ab273c3542b4d559.tar.bz2 |
Fix a couple of minor problems. Because PHI nodes can use themselves, this
could cause infinite loops. Also, getUnderlyingObject can return null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/BasicAliasAnalysis.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 617ae55..e928a26 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -159,9 +159,6 @@ static bool AddressMightEscape(const Value *V) { return true; if (AddressMightEscape(I)) return true; break; - case Instruction::PHI: - if (AddressMightEscape(I)) return true; - break; default: return true; } @@ -178,7 +175,7 @@ AliasAnalysis::ModRefResult BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) { if (!isa<Constant>(P) && !isa<GlobalValue>(P)) if (const AllocationInst *AI = - dyn_cast<AllocationInst>(getUnderlyingObject(P))) { + dyn_cast_or_null<AllocationInst>(getUnderlyingObject(P))) { // Okay, the pointer is to a stack allocated object. If we can prove that // the pointer never "escapes", then we know the call cannot clobber it, // because it simply can't get its address. |