[C++11] Use 'nullptr'. Analysis edition.

llvm-svn: 209191
diff --git a/clang/lib/Analysis/Consumed.cpp b/clang/lib/Analysis/Consumed.cpp
index e3dcb92..2027e77 100644
--- a/clang/lib/Analysis/Consumed.cpp
+++ b/clang/lib/Analysis/Consumed.cpp
@@ -710,7 +710,7 @@
       LTest = LEntry->second.getVarTest();
       
     } else {
-      LTest.Var      = NULL;
+      LTest.Var      = nullptr;
       LTest.TestsFor = CS_None;
     }
     
@@ -718,11 +718,11 @@
       RTest = REntry->second.getVarTest();
       
     } else {
-      RTest.Var      = NULL;
+      RTest.Var      = nullptr;
       RTest.TestsFor = CS_None;
     }
-    
-    if (!(LTest.Var == NULL && RTest.Var == NULL))
+
+    if (!(LTest.Var == nullptr && RTest.Var == nullptr))
       PropagationMap.insert(PairType(BinOp, PropagationInfo(BinOp,
         static_cast<EffectiveOp>(BinOp->getOpcode() == BO_LOr), LTest, RTest)));
     
@@ -763,7 +763,7 @@
     return;
   }
 
-  handleCall(Call, 0, FunDecl);
+  handleCall(Call, nullptr, FunDecl);
   propagateReturnType(Call, FunDecl);
 }
 
@@ -1072,9 +1072,9 @@
 
 void ConsumedBlockInfo::addInfo(const CFGBlock *Block,
                                 ConsumedStateMap *StateMap) {
-  
-  assert(Block != NULL && "Block pointer must not be NULL");
-  
+
+  assert(Block && "Block pointer must not be NULL");
+
   ConsumedStateMap *Entry = StateMapsArray[Block->getBlockID()];
     
   if (Entry) {
@@ -1096,7 +1096,7 @@
 void ConsumedBlockInfo::discardInfo(const CFGBlock *Block) {
   unsigned int BlockID = Block->getBlockID();
   delete StateMapsArray[BlockID];
-  StateMapsArray[BlockID] = NULL;
+  StateMapsArray[BlockID] = nullptr;
 }
 
 ConsumedStateMap* ConsumedBlockInfo::getInfo(const CFGBlock *Block) {
@@ -1106,7 +1106,7 @@
   if (isBackEdgeTarget(Block)) {
     return new ConsumedStateMap(*StateMap);
   } else {
-    StateMapsArray[Block->getBlockID()] = NULL;
+    StateMapsArray[Block->getBlockID()] = nullptr;
     return StateMap;
   }
 }
@@ -1119,8 +1119,8 @@
 }
 
 bool ConsumedBlockInfo::isBackEdgeTarget(const CFGBlock *Block) {
-  assert(Block != NULL && "Block pointer must not be NULL");
-  
+  assert(Block && "Block pointer must not be NULL");
+
   // Anything with less than two predecessors can't be the target of a back
   // edge.
   if (Block->pred_size() < 2)
@@ -1356,7 +1356,7 @@
   if (*++SI)
     BlockInfo.addInfo(*SI, FalseStates.release());
 
-  CurrStates = NULL;
+  CurrStates = nullptr;
   return true;
 }
 
@@ -1385,7 +1385,7 @@
   
   // Visit all of the function's basic blocks.
   for (const auto *CurrBlock : *SortedGraph) {
-    if (CurrStates == NULL)
+    if (!CurrStates)
       CurrStates = BlockInfo.getInfo(CurrBlock);
     
     if (!CurrStates) {
@@ -1393,7 +1393,7 @@
       
     } else if (!CurrStates->isReachable()) {
       delete CurrStates;
-      CurrStates = NULL;
+      CurrStates = nullptr;
       continue;
     }
     
@@ -1436,8 +1436,8 @@
     // TODO: Handle other forms of branching with precision, including while-
     //       and for-loops. (Deferred)
     if (!splitState(CurrBlock, Visitor)) {
-      CurrStates->setSource(NULL);
-      
+      CurrStates->setSource(nullptr);
+
       if (CurrBlock->succ_size() > 1 ||
           (CurrBlock->succ_size() == 1 &&
            (*CurrBlock->succ_begin())->pred_size() > 1)) {
@@ -1446,9 +1446,9 @@
         
         for (CFGBlock::const_succ_iterator SI = CurrBlock->succ_begin(),
              SE = CurrBlock->succ_end(); SI != SE; ++SI) {
-          
-          if (*SI == NULL) continue;
-          
+
+          if (*SI == nullptr) continue;
+
           if (BlockInfo.isBackEdge(CurrBlock, *SI)) {
             BlockInfo.borrowInfo(*SI)->intersectAtLoopHead(*SI, CurrBlock,
                                                            CurrStates,
@@ -1463,8 +1463,8 @@
         
         if (!OwnershipTaken)
           delete CurrStates;
-        
-        CurrStates = NULL;
+
+        CurrStates = nullptr;
       }
     }