[cfe-commits] r59020 - in /cfe/trunk/lib/CodeGen: CGStmt.cpp CodeGenFunction.cpp
Daniel Dunbar
daniel at zuster.org
Mon Nov 10 20:12:31 PST 2008
Author: ddunbar
Date: Mon Nov 10 22:12:31 2008
New Revision: 59020
URL: http://llvm.org/viewvc/llvm-project?rev=59020&view=rev
Log:
Remove CodeGenFunction::StartBlock.
- Was confusing and only used in one small part of the code.
Modified:
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=59020&r1=59019&r2=59020&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Mon Nov 10 22:12:31 2008
@@ -155,7 +155,7 @@
if (LastBB->getTerminator()) {
// If the previous block is already terminated, don't touch it.
- } else if (LastBB->empty() && isDummyBlock(LastBB)) {
+ } else if (isDummyBlock(LastBB)) {
// If the last block was an empty placeholder, remove it now.
// TODO: cache and reuse these.
LastBB->eraseFromParent();
@@ -510,7 +510,7 @@
// Emit the code for this case. We do this first to make sure it is
// properly chained from our predecessor before generating the
// switch machinery to enter this block.
- StartBlock("sw.bb");
+ EmitBlock(createBasicBlock("sw.bb"));
llvm::BasicBlock *CaseDest = Builder.GetInsertBlock();
EmitStmt(S.getSubStmt());
@@ -560,7 +560,7 @@
return;
}
- StartBlock("sw.bb");
+ EmitBlock(createBasicBlock("sw.bb"));
llvm::BasicBlock *CaseDest = Builder.GetInsertBlock();
llvm::APSInt CaseVal = S.getLHS()->getIntegerConstantExprValue(getContext());
SwitchInsn->addCase(llvm::ConstantInt::get(CaseVal), CaseDest);
@@ -592,7 +592,7 @@
CaseRangeBlock = DefaultBlock;
// Create basic block for body of switch
- StartBlock("sw.body");
+ EmitBlock(createBasicBlock("sw.body"));
// All break statements jump to NextBlock. If BreakContinueStack is non empty
// then reuse last ContinueBlock.
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=59020&r1=59019&r2=59020&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Mon Nov 10 22:12:31 2008
@@ -163,16 +163,6 @@
return false;
}
-/// StartBlock - Start new block named N. If insert block is a dummy block
-/// then reuse it.
-void CodeGenFunction::StartBlock(const char *N) {
- llvm::BasicBlock *BB = Builder.GetInsertBlock();
- if (!isDummyBlock(BB))
- EmitBlock(createBasicBlock(N));
- else
- BB->setName(N);
-}
-
/// getCGRecordLayout - Return record layout info.
const CGRecordLayout *CodeGenFunction::getCGRecordLayout(CodeGenTypes &CGT,
QualType Ty) {
More information about the cfe-commits
mailing list