[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 205831
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp
index f338dd7..a6cd03e 100644
--- a/llvm/lib/IR/Globals.cpp
+++ b/llvm/lib/IR/Globals.cpp
@@ -96,7 +96,7 @@
   : 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 @@
   : 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::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 @@
   for (;;) {
     GlobalValue *GV = getAliaseeGV(GA);
     if (!Visited.insert(GV))
-      return 0;
+      return nullptr;
 
     // Iterate over aliasing chain.
     GA = dyn_cast<GlobalAlias>(GV);