OSDN Git Service

bitcasts of pointers are always pointers.
authorChris Lattner <sabre@nondot.org>
Mon, 18 Feb 2008 02:11:28 +0000 (02:11 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 18 Feb 2008 02:11:28 +0000 (02:11 +0000)
If we see a memcpy of a pointer, make sure to check later
uses of the pointer as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47250 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index 430e74a..4c7259f 100644 (file)
@@ -219,8 +219,6 @@ static bool AddressMightEscape(const Value *V) {
         return true;
       break; // next use.
     case Instruction::BitCast:
-      if (!isa<PointerType>(I->getType()))
-        return true;
       if (AddressMightEscape(I))
         return true;
       break; // next use
@@ -231,10 +229,9 @@ static bool AddressMightEscape(const Value *V) {
     case Instruction::Call:
       // If the call is to a few known safe intrinsics, we know that it does
       // not escape
-      if (isa<MemIntrinsic>(I))
-        return false;
-      else
+      if (!isa<MemIntrinsic>(I))
         return true;
+      break;  // next use
     default:
       return true;
     }