llvm.org GIT mirror llvm / 02a3be0
Rename Function::getEntryNode -> getEntryBlock git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8625 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
13 changed file(s) with 21 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
216216 // except that the root node is implicitly the first node of the function.
217217 //
218218 template <> struct GraphTraits : public GraphTraits {
219 static NodeType *getEntryNode(Function *F) { return &F->getEntryNode(); }
219 static NodeType *getEntryNode(Function *F) { return &F->getEntryBlock(); }
220220
221221 // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
222222 typedef Function::iterator nodes_iterator;
225225 };
226226 template <> struct GraphTraits :
227227 public GraphTraits {
228 static NodeType *getEntryNode(const Function *F) { return &F->getEntryNode();}
228 static NodeType *getEntryNode(const Function *F) {return &F->getEntryBlock();}
229229
230230 // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
231231 typedef Function::const_iterator nodes_iterator;
242242 template <> struct GraphTraits > :
243243 public GraphTraits > {
244244 static NodeType *getEntryNode(Inverse G) {
245 return &G.Graph->getEntryNode();
245 return &G.Graph->getEntryBlock();
246246 }
247247 };
248248 template <> struct GraphTraits > :
249249 public GraphTraits > {
250250 static NodeType *getEntryNode(Inverse G) {
251 return &G.Graph->getEntryNode();
251 return &G.Graph->getEntryBlock();
252252 }
253253 };
254254
104104 if (!AI) return false;
105105 if (AI->isArrayAllocation())
106106 return 0; // FIXME: we can also inline fixed size array allocas!
107 if (AI->getParent() != &AI->getParent()->getParent()->getEntryNode())
107 if (AI->getParent() != &AI->getParent()->getParent()->getEntryBlock())
108108 return 0;
109109 return AI;
110110 }
104104 if (!AI) return false;
105105 if (AI->isArrayAllocation())
106106 return 0; // FIXME: we can also inline fixed size array allocas!
107 if (AI->getParent() != &AI->getParent()->getParent()->getEntryNode())
107 if (AI->getParent() != &AI->getParent()->getParent()->getEntryBlock())
108108 return 0;
109109 return AI;
110110 }
267267
268268 // Insert the setjmp map initialization before the first instruction in
269269 // the function.
270 Instruction* Inst = Func->getEntryNode().begin();
270 Instruction* Inst = Func->getEntryBlock().begin();
271271 assert(Inst && "Couldn't find even ONE instruction in entry block!");
272272
273273 // Fill in the alloca and call to initialize the SJ map.
227227
228228 // insert initialization code in first (entry) BB
229229 // this includes initializing r and count
230 insertInTopBB(&F.getEntryNode(),numPaths, rVar, threshold);
230 insertInTopBB(&F.getEntryBlock(), numPaths, rVar, threshold);
231231
232232 //now process the graph: get path numbers,
233233 //get increments along different paths,
347347 static inline void InsertCodeToShowFunctionEntry(Function &F, Function *Printf,
348348 Function* HashPtrToSeqNum){
349349 // Get an iterator to point to the insertion location
350 BasicBlock &BB = F.getEntryNode();
350 BasicBlock &BB = F.getEntryBlock();
351351 Instruction *InsertPos = BB.begin();
352352
353353 std::ostringstream OutStr;
397397 // Push a pointer set for recording alloca'd pointers at entry.
398398 if (!DisablePtrHashing)
399399 new CallInst(externalFuncs.PushOnEntryFunc, vector(), "",
400 F.getEntryNode().begin());
400 F.getEntryBlock().begin());
401401
402402 for (Function::iterator BB = F.begin(); BB != F.end(); ++BB) {
403403 if (isa(BB->getTerminator()))
194194 // transformations safely.
195195 //
196196 PostDominatorTree &DT = getAnalysis();
197 if (DT[&Func->getEntryNode()] == 0) {
197 if (DT[&Func->getEntryBlock()] == 0) {
198198 WorkList.clear();
199199 return MadeChanges;
200200 }
290290 DT = &getAnalysis();
291291
292292 std::set VisitedBlocks;
293 bool Changed = TransformRegion(&F.getEntryNode(), VisitedBlocks);
293 bool Changed = TransformRegion(&F.getEntryBlock(), VisitedBlocks);
294294
295295 RegionInfoMap.clear();
296296 RankMap.clear();
7474 std::vector Allocas;
7575 const TargetData &TD = getAnalysis();
7676
77 BasicBlock &BB = F.getEntryNode(); // Get the entry node for the function
77 BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function
7878
7979 bool Changed = false;
8080
107107 std::vector WorkList;
108108
109109 // Scan the entry basic block, adding any alloca's and mallocs to the worklist
110 BasicBlock &BB = F.getEntryNode();
110 BasicBlock &BB = F.getEntryBlock();
111111 for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
112112 if (AllocationInst *A = dyn_cast(I))
113113 WorkList.push_back(A);
6161 // Ok, so this is the first tail call we have found in this
6262 // function. Insert a new entry block into the function, allowing
6363 // us to branch back to the old entry block.
64 OldEntry = &F.getEntryNode();
64 OldEntry = &F.getEntryBlock();
6565 BasicBlock *NewEntry = new BasicBlock("tailrecurse", OldEntry);
6666 NewEntry->getInstList().push_back(new BranchInst(OldEntry));
6767
3737 std::vector Allocas;
3838 const TargetData &TD = getAnalysis();
3939
40 BasicBlock &BB = F.getEntryNode(); // Get the entry node for the function
40 BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function
4141
4242 bool Changed = false;
4343
8686 // specified function.
8787 //
8888 bool DominatorSet::runOnFunction(Function &F) {
89 BasicBlock *Root = &F.getEntryNode();
89 BasicBlock *Root = &F.getEntryBlock();
9090 Roots.clear();
9191 Roots.push_back(Root);
9292 assert(pred_begin(Root) == pred_end(Root) &&
227227 verifySymbolTable(F.getSymbolTable());
228228
229229 // Check the entry node
230 BasicBlock *Entry = &F.getEntryNode();
230 BasicBlock *Entry = &F.getEntryBlock();
231231 Assert1(pred_begin(Entry) == pred_end(Entry),
232232 "Entry block to function must not have predecessors!", Entry);
233233 }
481481
482482 // Use must be dominated by by definition unless use is unreachable!
483483 Assert2(DS->dominates(BB, Pred) ||
484 !DS->dominates(&BB->getParent()->getEntryNode(), Pred),
484 !DS->dominates(&BB->getParent()->getEntryBlock(), Pred),
485485 "Instruction does not dominate all uses!",
486486 &I, PN);
487487 }
489489 } else {
490490 // Use must be dominated by by definition unless use is unreachable!
491491 Assert2(DS->dominates(&I, Use) ||
492 !DS->dominates(&BB->getParent()->getEntryNode(),Use->getParent()),
492 !DS->dominates(&BB->getParent()->getEntryBlock(),
493 Use->getParent()),
493494 "Instruction does not dominate all uses!", &I, Use);
494495 }
495496 }