diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-04-09 06:08:46 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-04-09 06:08:46 +0000 |
commit | ec0f0bc6afa8d2c1f427ec55264fc78738b83ef6 (patch) | |
tree | 9fd922368890f4c0e51831dc17d85d7f793a15c3 /lib/IR/Globals.cpp | |
parent | 8a0d1c8f06391add493d0ff4b7344fce3420d2d5 (diff) | |
download | llvm-ec0f0bc6afa8d2c1f427ec55264fc78738b83ef6.tar.gz llvm-ec0f0bc6afa8d2c1f427ec55264fc78738b83ef6.tar.bz2 llvm-ec0f0bc6afa8d2c1f427ec55264fc78738b83ef6.tar.xz |
[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Globals.cpp')
-rw-r--r-- | lib/IR/Globals.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/IR/Globals.cpp b/lib/IR/Globals.cpp index f338dd76aa..a6cd03e622 100644 --- a/lib/IR/Globals.cpp +++ b/lib/IR/Globals.cpp @@ -96,7 +96,7 @@ GlobalVariable::GlobalVariable(Type *Ty, bool constant, LinkageTypes Link, : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal, OperandTraits<GlobalVariable>::op_begin(this), - InitVal != 0, Link, Name), + InitVal != nullptr, Link, Name), isConstantGlobal(constant), threadLocalMode(TLMode), isExternallyInitializedConstant(isExternallyInitialized) { if (InitVal) { @@ -117,7 +117,7 @@ GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant, : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalVariableVal, OperandTraits<GlobalVariable>::op_begin(this), - InitVal != 0, Link, Name), + InitVal != nullptr, Link, Name), isConstantGlobal(constant), threadLocalMode(TLMode), isExternallyInitializedConstant(isExternallyInitialized) { if (InitVal) { @@ -171,9 +171,9 @@ void GlobalVariable::replaceUsesOfWithOnConstant(Value *From, Value *To, } void GlobalVariable::setInitializer(Constant *InitVal) { - if (InitVal == 0) { + if (!InitVal) { if (hasInitializer()) { - Op<0>().set(0); + Op<0>().set(nullptr); NumOperands = 0; } } else { @@ -260,7 +260,7 @@ GlobalValue *GlobalAlias::getAliasedGlobal() { for (;;) { GlobalValue *GV = getAliaseeGV(GA); if (!Visited.insert(GV)) - return 0; + return nullptr; // Iterate over aliasing chain. GA = dyn_cast<GlobalAlias>(GV); |