summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-03-22 16:38:57 +0000
committerDan Gohman <gohman@apple.com>2007-03-22 16:38:57 +0000
commitecb7a77885b174cf4d001a9b48533b3979e7810d (patch)
treeed6b55df739771a7691a200f47883ddde4c45f53 /lib/Transforms
parent2b48420c642de2fbf68a96d9b0bf45b5379455f3 (diff)
downloadllvm-ecb7a77885b174cf4d001a9b48533b3979e7810d.tar.gz
llvm-ecb7a77885b174cf4d001a9b48533b3979e7810d.tar.bz2
llvm-ecb7a77885b174cf4d001a9b48533b3979e7810d.tar.xz
Change uses of Function::front to Function::getEntryBlock for readability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
-rw-r--r--lib/Transforms/Scalar/LICM.cpp2
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp2
-rw-r--r--lib/Transforms/Scalar/TailRecursionElimination.cpp2
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp2
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp2
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp7
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp3
8 files changed, 13 insertions, 10 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 1523f01f37..12f02f758e 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -9946,7 +9946,8 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
if (isa<PHINode>(I) || I->mayWriteToMemory()) return false;
// Do not sink alloca instructions out of the entry block.
- if (isa<AllocaInst>(I) && I->getParent() == &DestBlock->getParent()->front())
+ if (isa<AllocaInst>(I) && I->getParent() ==
+ &DestBlock->getParent()->getEntryBlock())
return false;
// We can only sink load instructions if there is nothing between the load and
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 7a578a8fb4..482ac77353 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -471,7 +471,7 @@ void LICM::sink(Instruction &I) {
if (I.getType() != Type::VoidTy)
AI = new AllocaInst(I.getType(), 0, I.getName(),
- I.getParent()->getParent()->front().begin());
+ I.getParent()->getParent()->getEntryBlock().begin());
// Secondly, insert load instructions for each use of the instruction
// outside of the loop.
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index a26fcbefe8..a29fe4ad3e 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -891,7 +891,7 @@ void SROA::ConvertToScalar(AllocationInst *AI, const Type *ActualTy) {
++NumConverted;
BasicBlock *EntryBlock = AI->getParent();
- assert(EntryBlock == &EntryBlock->getParent()->front() &&
+ assert(EntryBlock == &EntryBlock->getParent()->getEntryBlock() &&
"Not in the entry block!");
EntryBlock->getInstList().remove(AI); // Take the alloca out of the program.
diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp
index c1ce9d4d3d..cd3b79aab6 100644
--- a/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -108,7 +108,7 @@ static bool CheckForEscapingAllocas(BasicBlock *BB,
// If this alloca is in the body of the function, or if it is a variable
// sized allocation, we cannot tail call eliminate calls marked 'tail'
// with this mechanism.
- if (BB != &BB->getParent()->front() ||
+ if (BB != &BB->getParent()->getEntryBlock() ||
!isa<ConstantInt>(AI->getArraySize()))
CannotTCETailMarkedCall = true;
}
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index d80a83157a..cff58ab154 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/lib/Transforms/Utils/CloneFunction.cpp
@@ -59,7 +59,7 @@ BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB,
CodeInfo->ContainsUnwinds |= isa<UnwindInst>(BB->getTerminator());
CodeInfo->ContainsDynamicAllocas |= hasDynamicAllocas;
CodeInfo->ContainsDynamicAllocas |= hasStaticAllocas &&
- BB != &BB->getParent()->front();
+ BB != &BB->getParent()->getEntryBlock();
}
return NewBB;
}
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index f304df2a93..a4e7ab8972 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -104,7 +104,7 @@ void CodeExtractor::severSplitPHINodes(BasicBlock *&Header) {
bool HasPredsFromRegion = false;
unsigned NumPredsOutsideRegion = 0;
- if (Header != &Header->getParent()->front()) {
+ if (Header != &Header->getParent()->getEntryBlock()) {
PHINode *PN = dyn_cast<PHINode>(Header->begin());
if (!PN) return; // No PHI nodes.
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index d57a8f58ab..a1a638b0c2 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -265,9 +265,10 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {
// Transfer all of the allocas over in a block. Using splice means
// that the instructions aren't removed from the symbol table, then
// reinserted.
- Caller->front().getInstList().splice(InsertPoint,
- FirstNewBlock->getInstList(),
- AI, I);
+ Caller->getEntryBlock().getInstList().splice(
+ InsertPoint,
+ FirstNewBlock->getInstList(),
+ AI, I);
}
}
}
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 91664bf2d9..1bf72a1076 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1185,7 +1185,8 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
assert(BB && BB->getParent() && "Block not embedded in function!");
assert(BB->getTerminator() && "Degenerate basic block encountered!");
- assert(&BB->getParent()->front() != BB && "Can't Simplify entry block!");
+ assert(&BB->getParent()->getEntryBlock() != BB &&
+ "Can't Simplify entry block!");
// Remove basic blocks that have no predecessors... which are unreachable.
if (pred_begin(BB) == pred_end(BB) ||