diff options
author | Victor Hernandez <vhernandez@apple.com> | 2009-10-26 23:43:48 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2009-10-26 23:43:48 +0000 |
commit | de5ad42aa16287671b8e39173f8e0d39b8f35a73 (patch) | |
tree | 4b5bb9c47e42d2dc31877f0a8d5786927266b0c2 /llvm/lib/Analysis/CaptureTracking.cpp | |
parent | 7a484dd6a9a900c1c25794a0d555e40e417f693b (diff) | |
download | bcm5719-llvm-de5ad42aa16287671b8e39173f8e0d39b8f35a73.tar.gz bcm5719-llvm-de5ad42aa16287671b8e39173f8e0d39b8f35a73.zip |
Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.
llvm-svn: 85176
Diffstat (limited to 'llvm/lib/Analysis/CaptureTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/CaptureTracking.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp index b30ac719ae0..649b760b706 100644 --- a/llvm/lib/Analysis/CaptureTracking.cpp +++ b/llvm/lib/Analysis/CaptureTracking.cpp @@ -17,6 +17,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/CaptureTracking.h" +#include "llvm/Analysis/MallocHelper.h" #include "llvm/Instructions.h" #include "llvm/Value.h" #include "llvm/ADT/SmallSet.h" @@ -48,6 +49,9 @@ bool llvm::PointerMayBeCaptured(const Value *V, bool ReturnCaptures) { switch (I->getOpcode()) { case Instruction::Call: + if (isFreeCall(I)) + // Freeing a pointer does not cause it to be captured. + break; case Instruction::Invoke: { CallSite CS = CallSite::get(I); // Not captured if the callee is readonly, doesn't return a copy through @@ -73,9 +77,6 @@ bool llvm::PointerMayBeCaptured(const Value *V, bool ReturnCaptures) { // captured. break; } - case Instruction::Free: - // Freeing a pointer does not cause it to be captured. - break; case Instruction::Load: // Loading from a pointer does not cause it to be captured. break; |