Rename Function::getEntryNode -> getEntryBlock
authorChris Lattner <sabre@nondot.org>
Sat, 20 Sep 2003 14:39:18 +0000 (14:39 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 20 Sep 2003 14:39:18 +0000 (14:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8625 91177308-0d34-0410-b5e6-96231b3b80d8

13 files changed:
include/llvm/Support/CFG.h
lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp
lib/Transforms/IPO/LowerSetJmp.cpp
lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
lib/Transforms/Instrumentation/TraceValues.cpp
lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/CorrelatedExprs.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/Transforms/Scalar/TailRecursionElimination.cpp
lib/Transforms/Utils/Mem2Reg.cpp
lib/VMCore/Dominators.cpp
lib/VMCore/Verifier.cpp

index aab0db9712b9f1aeefca7dd80dd148a64dd8e18c..6a3abd92603ca298a2acda45b223428b743b722c 100644 (file)
@@ -217,7 +217,7 @@ template <> struct GraphTraits<Inverse<const BasicBlock*> > {
 // except that the root node is implicitly the first node of the function.
 //
 template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
-  static NodeType *getEntryNode(Function *F) { return &F->getEntryNode(); }
+  static NodeType *getEntryNode(Function *F) { return &F->getEntryBlock(); }
 
   // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
   typedef Function::iterator nodes_iterator;
@@ -226,7 +226,7 @@ template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
 };
 template <> struct GraphTraits<const Function*> :
   public GraphTraits<const BasicBlock*> {
-  static NodeType *getEntryNode(const Function *F) { return &F->getEntryNode();}
+  static NodeType *getEntryNode(const Function *F) {return &F->getEntryBlock();}
 
   // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
   typedef Function::const_iterator nodes_iterator;
@@ -243,13 +243,13 @@ template <> struct GraphTraits<const Function*> :
 template <> struct GraphTraits<Inverse<Function*> > :
   public GraphTraits<Inverse<BasicBlock*> > {
   static NodeType *getEntryNode(Inverse<Function*> G) {
-    return &G.Graph->getEntryNode();
+    return &G.Graph->getEntryBlock();
   }
 };
 template <> struct GraphTraits<Inverse<const Function*> > :
   public GraphTraits<Inverse<const BasicBlock*> > {
   static NodeType *getEntryNode(Inverse<const Function *> G) {
-    return &G.Graph->getEntryNode();
+    return &G.Graph->getEntryBlock();
   }
 };
 
index 65919e8c48d9cc6423f9dff589312003c6410ff1..16d55feb47d2680a5a4f2b53ff3a7254d9746b11 100644 (file)
@@ -105,7 +105,7 @@ namespace {
       if (!AI) return false;
       if (AI->isArrayAllocation())
         return 0;   // FIXME: we can also inline fixed size array allocas!
-      if (AI->getParent() != &AI->getParent()->getParent()->getEntryNode())
+      if (AI->getParent() != &AI->getParent()->getParent()->getEntryBlock())
         return 0;
       return AI;
     }
index 65919e8c48d9cc6423f9dff589312003c6410ff1..16d55feb47d2680a5a4f2b53ff3a7254d9746b11 100644 (file)
@@ -105,7 +105,7 @@ namespace {
       if (!AI) return false;
       if (AI->isArrayAllocation())
         return 0;   // FIXME: we can also inline fixed size array allocas!
-      if (AI->getParent() != &AI->getParent()->getParent()->getEntryNode())
+      if (AI->getParent() != &AI->getParent()->getParent()->getEntryBlock())
         return 0;
       return AI;
     }
index fc9af5bc57fdc88c8d711a9f9e93cf256d99343c..d6c02569a7311e50af7c93680232afa19141ec7d 100644 (file)
@@ -268,7 +268,7 @@ AllocaInst* LowerSetJmp::GetSetJmpMap(Function* Func)
 
   // Insert the setjmp map initialization before the first instruction in
   // the function.
-  Instruction* Inst = Func->getEntryNode().begin();
+  Instruction* Inst = Func->getEntryBlock().begin();
   assert(Inst && "Couldn't find even ONE instruction in entry block!");
 
   // Fill in the alloca and call to initialize the SJ map.
index e94f0b7876e7c2bdb39dae43a01e8f6e3e04033d..aa46048ae0343b9d27f53816b247b3f156ac1e69 100644 (file)
@@ -228,7 +228,7 @@ bool ProfilePaths::runOnFunction(Function &F){
   
   // insert initialization code in first (entry) BB
   // this includes initializing r and count
-  insertInTopBB(&F.getEntryNode(),numPaths, rVar, threshold);
+  insertInTopBB(&F.getEntryBlock(), numPaths, rVar, threshold);
     
   //now process the graph: get path numbers,
   //get increments along different paths,
index 375a45d69a1a30f953e4ed08a4059c02abc1304e..45799727c3f67a882462298af82b60ca8cbff06e 100644 (file)
@@ -348,7 +348,7 @@ static void TraceValuesAtBBExit(BasicBlock *BB,
 static inline void InsertCodeToShowFunctionEntry(Function &F, Function *Printf,
                                                  Function* HashPtrToSeqNum){
   // Get an iterator to point to the insertion location
-  BasicBlock &BB = F.getEntryNode();
+  BasicBlock &BB = F.getEntryBlock();
   Instruction *InsertPos = BB.begin();
 
   std::ostringstream OutStr;
@@ -398,7 +398,7 @@ bool InsertTraceCode::runOnFunction(Function &F) {
   // Push a pointer set for recording alloca'd pointers at entry.
   if (!DisablePtrHashing)
     new CallInst(externalFuncs.PushOnEntryFunc, vector<Value*>(), "",
-                 F.getEntryNode().begin());
+                 F.getEntryBlock().begin());
 
   for (Function::iterator BB = F.begin(); BB != F.end(); ++BB) {
     if (isa<ReturnInst>(BB->getTerminator()))
index 897e2093fcd3b714d8e3ed7b87b18455a8f24254..8d71605406095aecbb8223afafd87c19c6bc0c20 100644 (file)
@@ -195,7 +195,7 @@ bool ADCE::doADCE() {
   // transformations safely.
   //
   PostDominatorTree &DT = getAnalysis<PostDominatorTree>();
-  if (DT[&Func->getEntryNode()] == 0) {
+  if (DT[&Func->getEntryBlock()] == 0) {
     WorkList.clear();
     return MadeChanges;
   }
index 545c256d454034512b544925442506f7a06e94ef..6003c81278d873e53fee8b962f137664f4cab29e 100644 (file)
@@ -291,7 +291,7 @@ bool CEE::runOnFunction(Function &F) {
   DT = &getAnalysis<DominatorTree>();
   
   std::set<BasicBlock*> VisitedBlocks;
-  bool Changed = TransformRegion(&F.getEntryNode(), VisitedBlocks);
+  bool Changed = TransformRegion(&F.getEntryBlock(), VisitedBlocks);
 
   RegionInfoMap.clear();
   RankMap.clear();
index 2a6bddfb325e455f1982ee7325028fd94e715277..adcbaffac006365c280946052ea1965b46339340 100644 (file)
@@ -75,7 +75,7 @@ bool SROA::performPromotion(Function &F) {
   std::vector<AllocaInst*> Allocas;
   const TargetData &TD = getAnalysis<TargetData>();
 
-  BasicBlock &BB = F.getEntryNode();  // Get the entry node for the function
+  BasicBlock &BB = F.getEntryBlock();  // Get the entry node for the function
 
   bool Changed = false;
   
@@ -108,7 +108,7 @@ bool SROA::performScalarRepl(Function &F) {
   std::vector<AllocationInst*> WorkList;
 
   // Scan the entry basic block, adding any alloca's and mallocs to the worklist
-  BasicBlock &BB = F.getEntryNode();
+  BasicBlock &BB = F.getEntryBlock();
   for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
     if (AllocationInst *A = dyn_cast<AllocationInst>(I))
       WorkList.push_back(A);
index c8ac4c5ff77f513066dbe05667b7104040d3bd55..447c0ae849ed6fb19d7921eb6e6aa0d78115187a 100644 (file)
@@ -62,7 +62,7 @@ bool TailCallElim::runOnFunction(Function &F) {
               // Ok, so this is the first tail call we have found in this
               // function.  Insert a new entry block into the function, allowing
               // us to branch back to the old entry block.
-              OldEntry = &F.getEntryNode();
+              OldEntry = &F.getEntryBlock();
               BasicBlock *NewEntry = new BasicBlock("tailrecurse", OldEntry);
               NewEntry->getInstList().push_back(new BranchInst(OldEntry));
               
index b731ab1a4f7c025505ed1915278352b8e82ec811..16d05d8213db17b72d42d5aa602c67574e1314eb 100644 (file)
@@ -38,7 +38,7 @@ bool PromotePass::runOnFunction(Function &F) {
   std::vector<AllocaInst*> Allocas;
   const TargetData &TD = getAnalysis<TargetData>();
 
-  BasicBlock &BB = F.getEntryNode();  // Get the entry node for the function
+  BasicBlock &BB = F.getEntryBlock();  // Get the entry node for the function
 
   bool Changed  = false;
   
index f22bd0c078f949d1e749c55fb93dd4ac4ce15396..671b49425eeb6a18cd172859b87da4207105d252 100644 (file)
@@ -87,7 +87,7 @@ void DominatorSet::calculateDominatorsFromBlock(BasicBlock *RootBB) {
 // specified function.
 //
 bool DominatorSet::runOnFunction(Function &F) {
-  BasicBlock *Root = &F.getEntryNode();
+  BasicBlock *Root = &F.getEntryBlock();
   Roots.clear();
   Roots.push_back(Root);
   assert(pred_begin(Root) == pred_end(Root) &&
index ace5775a0a719556236bae5cf68d0963f818948f..51d378dfd1ac4e3e01ba1bb73844727181842470 100644 (file)
@@ -228,7 +228,7 @@ void Verifier::visitFunction(Function &F) {
     verifySymbolTable(F.getSymbolTable());
 
     // Check the entry node
-    BasicBlock *Entry = &F.getEntryNode();
+    BasicBlock *Entry = &F.getEntryBlock();
     Assert1(pred_begin(Entry) == pred_end(Entry),
             "Entry block to function must not have predecessors!", Entry);
   }
@@ -482,7 +482,7 @@ void Verifier::visitInstruction(Instruction &I) {
           
           // Use must be dominated by by definition unless use is unreachable!
           Assert2(DS->dominates(BB, Pred) ||
-                  !DS->dominates(&BB->getParent()->getEntryNode(), Pred),
+                  !DS->dominates(&BB->getParent()->getEntryBlock(), Pred),
                   "Instruction does not dominate all uses!",
                   &I, PN);
         }
@@ -490,7 +490,8 @@ void Verifier::visitInstruction(Instruction &I) {
     } else {
       // Use must be dominated by by definition unless use is unreachable!
       Assert2(DS->dominates(&I, Use) ||
-              !DS->dominates(&BB->getParent()->getEntryNode(),Use->getParent()),
+              !DS->dominates(&BB->getParent()->getEntryBlock(),
+                             Use->getParent()),
               "Instruction does not dominate all uses!", &I, Use);
     }
   }