diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-07-06 00:29:58 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-07-06 00:29:58 +0000 |
commit | dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed (patch) | |
tree | 1838b5d8368383a083fad1cdca2fe777528e5a69 /lib/Analysis/CaptureTracking.cpp | |
parent | 202eb7b18e220205ec86a03ddf18f2066c70ab15 (diff) | |
download | llvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.tar.gz llvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.tar.bz2 llvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CaptureTracking.cpp')
-rw-r--r-- | lib/Analysis/CaptureTracking.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/CaptureTracking.cpp b/lib/Analysis/CaptureTracking.cpp index a7292706df..9eb76a8b27 100644 --- a/lib/Analysis/CaptureTracking.cpp +++ b/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. |