summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/Loads.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-04-15 04:59:12 +0000
committerCraig Topper <craig.topper@gmail.com>2014-04-15 04:59:12 +0000
commit9f008867c063919762189487e78bcb7ace2b256d (patch)
treea768a65bc7a91c59f5d98aadbb7d827fdeb30ccd /llvm/lib/Analysis/Loads.cpp
parent4a7a0509102a0af018011d2708bf321fa6984596 (diff)
downloadbcm5719-llvm-9f008867c063919762189487e78bcb7ace2b256d.tar.gz
bcm5719-llvm-9f008867c063919762189487e78bcb7ace2b256d.zip
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 206243
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r--llvm/lib/Analysis/Loads.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp
index 0902a39a9f8..005d309894c 100644
--- a/llvm/lib/Analysis/Loads.cpp
+++ b/llvm/lib/Analysis/Loads.cpp
@@ -62,7 +62,7 @@ bool llvm::isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom,
if (ByteOffset < 0) // out of bounds
return false;
- Type *BaseType = 0;
+ Type *BaseType = nullptr;
unsigned BaseAlign = 0;
if (const AllocaInst *AI = dyn_cast<AllocaInst>(Base)) {
// An alloca is safe to load from as load as it is suitably aligned.
@@ -161,7 +161,7 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB,
ScanFrom++;
// Don't scan huge blocks.
- if (MaxInstsToScan-- == 0) return 0;
+ if (MaxInstsToScan-- == 0) return nullptr;
--ScanFrom;
// If this is a load of Ptr, the loaded value is available.
@@ -198,7 +198,7 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB,
// Otherwise the store that may or may not alias the pointer, bail out.
++ScanFrom;
- return 0;
+ return nullptr;
}
// If this is some other instruction that may clobber Ptr, bail out.
@@ -211,11 +211,11 @@ Value *llvm::FindAvailableLoadedValue(Value *Ptr, BasicBlock *ScanBB,
// May modify the pointer, bail out.
++ScanFrom;
- return 0;
+ return nullptr;
}
}
// Got to the start of the block, we didn't find it, but are done for this
// block.
- return 0;
+ return nullptr;
}
OpenPOWER on IntegriCloud