forked from OSchip/llvm-project
Make addStmt always add stmt. Delegate other cases to Visit() directly.
llvm-svn: 105384
This commit is contained in:
parent
41cdf585c2
commit
ea9fcffe03
|
@ -171,8 +171,8 @@ private:
|
|||
void autoCreateBlock() { if (!Block) Block = createBlock(); }
|
||||
CFGBlock *createBlock(bool add_successor = true);
|
||||
bool FinishBlock(CFGBlock* B);
|
||||
CFGBlock *addStmt(Stmt *S, AddStmtChoice asc = AddStmtChoice::AlwaysAdd) {
|
||||
return Visit(S, asc);
|
||||
CFGBlock *addStmt(Stmt *S) {
|
||||
return Visit(S, AddStmtChoice::AlwaysAdd);
|
||||
}
|
||||
|
||||
void AppendStmt(CFGBlock *B, Stmt *S,
|
||||
|
@ -664,13 +664,13 @@ CFGBlock *CFGBuilder::VisitChooseExpr(ChooseExpr *C,
|
|||
|
||||
Succ = ConfluenceBlock;
|
||||
Block = NULL;
|
||||
CFGBlock* LHSBlock = addStmt(C->getLHS(), asc);
|
||||
CFGBlock* LHSBlock = Visit(C->getLHS(), asc);
|
||||
if (!FinishBlock(LHSBlock))
|
||||
return 0;
|
||||
|
||||
Succ = ConfluenceBlock;
|
||||
Block = NULL;
|
||||
CFGBlock* RHSBlock = addStmt(C->getRHS(), asc);
|
||||
CFGBlock* RHSBlock = Visit(C->getRHS(), asc);
|
||||
if (!FinishBlock(RHSBlock))
|
||||
return 0;
|
||||
|
||||
|
@ -722,7 +722,7 @@ CFGBlock *CFGBuilder::VisitConditionalOperator(ConditionalOperator *C,
|
|||
Block = NULL;
|
||||
CFGBlock* LHSBlock = NULL;
|
||||
if (C->getLHS()) {
|
||||
LHSBlock = addStmt(C->getLHS(), asc);
|
||||
LHSBlock = Visit(C->getLHS(), asc);
|
||||
if (!FinishBlock(LHSBlock))
|
||||
return 0;
|
||||
Block = NULL;
|
||||
|
@ -730,7 +730,7 @@ CFGBlock *CFGBuilder::VisitConditionalOperator(ConditionalOperator *C,
|
|||
|
||||
// Create the block for the RHS expression.
|
||||
Succ = ConfluenceBlock;
|
||||
CFGBlock* RHSBlock = addStmt(C->getRHS(), asc);
|
||||
CFGBlock* RHSBlock = Visit(C->getRHS(), asc);
|
||||
if (!FinishBlock(RHSBlock))
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue