summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasSetTracker.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/AliasSetTracker.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/AliasSetTracker.cpp')
-rw-r--r--llvm/lib/Analysis/AliasSetTracker.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index ab1005e83c3..a45fe2389ee 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -72,16 +72,16 @@ void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST) {
AS.PtrList->setPrevInList(PtrListEnd);
PtrListEnd = AS.PtrListEnd;
- AS.PtrList = 0;
+ AS.PtrList = nullptr;
AS.PtrListEnd = &AS.PtrList;
- assert(*AS.PtrListEnd == 0 && "End of list is not null?");
+ assert(*AS.PtrListEnd == nullptr && "End of list is not null?");
}
}
void AliasSetTracker::removeAliasSet(AliasSet *AS) {
if (AliasSet *Fwd = AS->Forward) {
Fwd->dropRef(*this);
- AS->Forward = 0;
+ AS->Forward = nullptr;
}
AliasSets.erase(AS);
}
@@ -115,10 +115,10 @@ void AliasSet::addPointer(AliasSetTracker &AST, PointerRec &Entry,
Entry.updateSizeAndTBAAInfo(Size, TBAAInfo);
// Add it to the end of the list...
- assert(*PtrListEnd == 0 && "End of list is not null?");
+ assert(*PtrListEnd == nullptr && "End of list is not null?");
*PtrListEnd = &Entry;
PtrListEnd = Entry.setPrevInList(PtrListEnd);
- assert(*PtrListEnd == 0 && "End of list is not null?");
+ assert(*PtrListEnd == nullptr && "End of list is not null?");
addRef(); // Entry points to alias set.
}
@@ -217,11 +217,11 @@ void AliasSetTracker::clear() {
AliasSet *AliasSetTracker::findAliasSetForPointer(const Value *Ptr,
uint64_t Size,
const MDNode *TBAAInfo) {
- AliasSet *FoundSet = 0;
+ AliasSet *FoundSet = nullptr;
for (iterator I = begin(), E = end(); I != E; ++I) {
if (I->Forward || !I->aliasesPointer(Ptr, Size, TBAAInfo, AA)) continue;
- if (FoundSet == 0) { // If this is the first alias set ptr can go into.
+ if (!FoundSet) { // If this is the first alias set ptr can go into.
FoundSet = I; // Remember it.
} else { // Otherwise, we must merge the sets.
FoundSet->mergeSetIn(*I, *this); // Merge in contents.
@@ -245,12 +245,12 @@ bool AliasSetTracker::containsPointer(Value *Ptr, uint64_t Size,
AliasSet *AliasSetTracker::findAliasSetForUnknownInst(Instruction *Inst) {
- AliasSet *FoundSet = 0;
+ AliasSet *FoundSet = nullptr;
for (iterator I = begin(), E = end(); I != E; ++I) {
if (I->Forward || !I->aliasesUnknownInst(Inst, AA))
continue;
- if (FoundSet == 0) // If this is the first alias set ptr can go into.
+ if (!FoundSet) // If this is the first alias set ptr can go into.
FoundSet = I; // Remember it.
else if (!I->Forward) // Otherwise, we must merge the sets.
FoundSet->mergeSetIn(*I, *this); // Merge in contents.
OpenPOWER on IntegriCloud