diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-04-25 05:30:21 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-04-25 05:30:21 +0000 |
commit | c848b1bbcf88ab5d8318d990612fb1fda206ea3d (patch) | |
tree | 5f23141128a60d64062ac667e151bf2267f50d8e /lib/Target/NVPTX/NVPTXUtilities.cpp | |
parent | 8d7221ccf5012e7ece93aa976bf2603789b31441 (diff) | |
download | llvm-c848b1bbcf88ab5d8318d990612fb1fda206ea3d.tar.gz llvm-c848b1bbcf88ab5d8318d990612fb1fda206ea3d.tar.bz2 llvm-c848b1bbcf88ab5d8318d990612fb1fda206ea3d.tar.xz |
[C++] Use 'nullptr'. Target edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/NVPTX/NVPTXUtilities.cpp')
-rw-r--r-- | lib/Target/NVPTX/NVPTXUtilities.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Target/NVPTX/NVPTXUtilities.cpp b/lib/Target/NVPTX/NVPTXUtilities.cpp index 082d32ec2f..a9fd190b7f 100644 --- a/lib/Target/NVPTX/NVPTXUtilities.cpp +++ b/lib/Target/NVPTX/NVPTXUtilities.cpp @@ -393,12 +393,12 @@ llvm::skipPointerTransfer(const Value *V, bool ignore_GEP_indices) { const Value * llvm::skipPointerTransfer(const Value *V, std::set<const Value *> &processed) { if (processed.find(V) != processed.end()) - return NULL; + return nullptr; processed.insert(V); const Value *V2 = V->stripPointerCasts(); if (V2 != V && processed.find(V2) != processed.end()) - return NULL; + return nullptr; processed.insert(V2); V = V2; @@ -414,20 +414,20 @@ llvm::skipPointerTransfer(const Value *V, std::set<const Value *> &processed) { continue; } else if (const PHINode *PN = dyn_cast<PHINode>(V)) { if (V != V2 && processed.find(V) != processed.end()) - return NULL; + return nullptr; processed.insert(PN); - const Value *common = 0; + const Value *common = nullptr; for (unsigned i = 0; i != PN->getNumIncomingValues(); ++i) { const Value *pv = PN->getIncomingValue(i); const Value *base = skipPointerTransfer(pv, processed); if (base) { - if (common == 0) + if (!common) common = base; else if (common != base) return PN; } } - if (common == 0) + if (!common) return PN; V = common; } @@ -445,7 +445,7 @@ BasicBlock *llvm::getParentBlock(Value *v) { if (Instruction *I = dyn_cast<Instruction>(v)) return I->getParent(); - return 0; + return nullptr; } Function *llvm::getParentFunction(Value *v) { @@ -458,13 +458,13 @@ Function *llvm::getParentFunction(Value *v) { if (BasicBlock *B = dyn_cast<BasicBlock>(v)) return B->getParent(); - return 0; + return nullptr; } // Dump a block by name void llvm::dumpBlock(Value *v, char *blockName) { Function *F = getParentFunction(v); - if (F == 0) + if (!F) return; for (Function::iterator it = F->begin(), ie = F->end(); it != ie; ++it) { @@ -479,8 +479,8 @@ void llvm::dumpBlock(Value *v, char *blockName) { // Find an instruction by name Instruction *llvm::getInst(Value *base, char *instName) { Function *F = getParentFunction(base); - if (F == 0) - return 0; + if (!F) + return nullptr; for (inst_iterator it = inst_begin(F), ie = inst_end(F); it != ie; ++it) { Instruction *I = &*it; @@ -489,7 +489,7 @@ Instruction *llvm::getInst(Value *base, char *instName) { } } - return 0; + return nullptr; } // Dump an instruction by nane |