Implement review feedback.
authorChristopher Lamb <christopher.lamb@gmail.com>
Thu, 2 Aug 2007 17:52:00 +0000 (17:52 +0000)
committerChristopher Lamb <christopher.lamb@gmail.com>
Thu, 2 Aug 2007 17:52:00 +0000 (17:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40745 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index 39f232e3e5603daee456885a3572e176e9258c12..eba21314173d90e50f142e599ea66e2a696e1d4b 100644 (file)
@@ -311,25 +311,25 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
   // Pointing at a discernible object?
   if (O1) {
     if (O2) {
-      if (isa<Argument>(O1)) {
+      if (const Argument *O1Arg = dyn_cast<Argument>(O1)) {
         // Incoming argument cannot alias locally allocated object!
         if (isa<AllocationInst>(O2)) return NoAlias;
         
         // If they are two different objects, and one is a noalias argument
         // then they do not alias.
-        if (O1 != O2 && isNoAliasArgument(cast<Argument>(O1)))
+        if (O1 != O2 && isNoAliasArgument(O1Arg))
           return NoAlias;
           
         // Otherwise, nothing is known...
       } 
       
-      if (isa<Argument>(O2)) {
+      if (const Argument *O2Arg = dyn_cast<Argument>(O2)) {
         // Incoming argument cannot alias locally allocated object!
         if (isa<AllocationInst>(O1)) return NoAlias;
         
         // If they are two different objects, and one is a noalias argument
         // then they do not alias.
-        if (O1 != O2 && isNoAliasArgument(cast<Argument>(O2)))
+        if (O1 != O2 && isNoAliasArgument(O2Arg))
           return NoAlias;
           
         // Otherwise, nothing is known...