Simplify code: Succ is guaranteed to be not NULL.

llvm-svn: 96772
This commit is contained in:
Zhongxing Xu 2010-02-22 02:59:27 +00:00
parent 740909be2d
commit d39620c451
1 changed files with 29 additions and 29 deletions

View File

@ -264,10 +264,11 @@ CFG* CFGBuilder::buildCFG(const Decl *D, Stmt* Statement, ASTContext* C,
if (!B)
B = Succ;
if (B) {
assert(B);
// Finalize the last constructed block. This usually involves reversing the
// order of the statements in the block.
if (Block) FinishBlock(B);
FinishBlock(B);
// Backpatch the gotos whose label -> block mappings we didn't know when we
// encountered them.
@ -301,7 +302,6 @@ CFG* CFGBuilder::buildCFG(const Decl *D, Stmt* Statement, ASTContext* C,
}
Succ = B;
}
// Create an empty entry block that has no predecessors.
cfg->setEntry(createBlock());