X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FGenericDomTreeConstruction.h;h=ad4f8a9f429a7c9ce6f764c23abd5d8ec5ad55e9;hb=5401ba7099b9f3cd32b3399276b549bea15e5d1e;hp=f6bb8f47eb65c743acd07833307b89ae666463c1;hpb=d522121f2426127463e33d3ed971eddf910967e7;p=oota-llvm.git diff --git a/include/llvm/Support/GenericDomTreeConstruction.h b/include/llvm/Support/GenericDomTreeConstruction.h index f6bb8f47eb6..ad4f8a9f429 100644 --- a/include/llvm/Support/GenericDomTreeConstruction.h +++ b/include/llvm/Support/GenericDomTreeConstruction.h @@ -22,8 +22,8 @@ //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_GENERIC_DOM_TREE_CONSTRUCTION_H -#define LLVM_SUPPORT_GENERIC_DOM_TREE_CONSTRUCTION_H +#ifndef LLVM_SUPPORT_GENERICDOMTREECONSTRUCTION_H +#define LLVM_SUPPORT_GENERICDOMTREECONSTRUCTION_H #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/GenericDomTree.h" @@ -125,7 +125,7 @@ Eval(DominatorTreeBase& DT, typename GraphT::NodeType* VAncestor = DT.Vertex[VInfo.Parent]; // Process Ancestor first - if (Visited.insert(VAncestor) && VInfo.Parent >= LastLinked) { + if (Visited.insert(VAncestor).second && VInfo.Parent >= LastLinked) { Work.push_back(VAncestor); continue; } @@ -156,11 +156,11 @@ void Calculate(DominatorTreeBase::NodeType>& DT, bool MultipleRoots = (DT.Roots.size() > 1); if (MultipleRoots) { typename DominatorTreeBase::InfoRec &BBInfo = - DT.Info[NULL]; + DT.Info[nullptr]; BBInfo.DFSNum = BBInfo.Semi = ++N; - BBInfo.Label = NULL; + BBInfo.Label = nullptr; - DT.Vertex.push_back(NULL); // Vertex[n] = V; + DT.Vertex.push_back(nullptr); // Vertex[n] = V; } // Step #1: Number blocks in depth-first order and initialize variables used @@ -249,10 +249,10 @@ void Calculate(DominatorTreeBase::NodeType>& DT, // one exit block, or it may be the virtual exit (denoted by (BasicBlock *)0) // which postdominates all real exits if there are multiple exit blocks, or // an infinite loop. - typename GraphT::NodeType* Root = !MultipleRoots ? DT.Roots[0] : 0; + typename GraphT::NodeType* Root = !MultipleRoots ? DT.Roots[0] : nullptr; DT.DomTreeNodes[Root] = DT.RootNode = - new DomTreeNodeBase(Root, 0); + new DomTreeNodeBase(Root, nullptr); // Loop over all of the reachable blocks in the function... for (unsigned i = 2; i <= N; ++i) { @@ -263,7 +263,7 @@ void Calculate(DominatorTreeBase::NodeType>& DT, typename GraphT::NodeType* ImmDom = DT.getIDom(W); - assert(ImmDom || DT.DomTreeNodes[NULL]); + assert(ImmDom || DT.DomTreeNodes[nullptr]); // Get or calculate the node for the immediate dominator DomTreeNodeBase *IDomNode =