aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CaptureTracking.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-07-06 00:29:58 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-07-06 00:29:58 +0000
commitc2ec0725cedceb851858c3991fbdd36ee9ac85dd (patch)
tree841ddf4ab15a0d446543803d7124a7716619cb04 /llvm/lib/Analysis/CaptureTracking.cpp
parente8545dde7be8fe78e64bf4d9578c25368243c274 (diff)
downloadllvm-c2ec0725cedceb851858c3991fbdd36ee9ac85dd.zip
llvm-c2ec0725cedceb851858c3991fbdd36ee9ac85dd.tar.gz
llvm-c2ec0725cedceb851858c3991fbdd36ee9ac85dd.tar.bz2
Extend 'readonly' and 'readnone' to work on function arguments as well as
functions. Make the function attributes pass add it to known library functions and when it can deduce it. llvm-svn: 185735
Diffstat (limited to 'llvm/lib/Analysis/CaptureTracking.cpp')
-rw-r--r--llvm/lib/Analysis/CaptureTracking.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/CaptureTracking.cpp b/llvm/lib/Analysis/CaptureTracking.cpp
index a729270..9eb76a8 100644
--- a/llvm/lib/Analysis/CaptureTracking.cpp
+++ b/llvm/lib/Analysis/CaptureTracking.cpp
@@ -158,10 +158,10 @@ void llvm::PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker) {
// Don't count comparisons of a no-alias return value against null as
// captures. This allows us to ignore comparisons of malloc results
// with null, for example.
- if (isNoAliasCall(V->stripPointerCasts()))
- if (ConstantPointerNull *CPN =
- dyn_cast<ConstantPointerNull>(I->getOperand(1)))
- if (CPN->getType()->getAddressSpace() == 0)
+ if (ConstantPointerNull *CPN =
+ dyn_cast<ConstantPointerNull>(I->getOperand(1)))
+ if (CPN->getType()->getAddressSpace() == 0)
+ if (isNoAliasCall(V->stripPointerCasts()))
break;
// Otherwise, be conservative. There are crazy ways to capture pointers
// using comparisons.