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(); }
|
void autoCreateBlock() { if (!Block) Block = createBlock(); }
|
||||||
CFGBlock *createBlock(bool add_successor = true);
|
CFGBlock *createBlock(bool add_successor = true);
|
||||||
bool FinishBlock(CFGBlock* B);
|
bool FinishBlock(CFGBlock* B);
|
||||||
CFGBlock *addStmt(Stmt *S, AddStmtChoice asc = AddStmtChoice::AlwaysAdd) {
|
CFGBlock *addStmt(Stmt *S) {
|
||||||
return Visit(S, asc);
|
return Visit(S, AddStmtChoice::AlwaysAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppendStmt(CFGBlock *B, Stmt *S,
|
void AppendStmt(CFGBlock *B, Stmt *S,
|
||||||
|
@ -664,13 +664,13 @@ CFGBlock *CFGBuilder::VisitChooseExpr(ChooseExpr *C,
|
||||||
|
|
||||||
Succ = ConfluenceBlock;
|
Succ = ConfluenceBlock;
|
||||||
Block = NULL;
|
Block = NULL;
|
||||||
CFGBlock* LHSBlock = addStmt(C->getLHS(), asc);
|
CFGBlock* LHSBlock = Visit(C->getLHS(), asc);
|
||||||
if (!FinishBlock(LHSBlock))
|
if (!FinishBlock(LHSBlock))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Succ = ConfluenceBlock;
|
Succ = ConfluenceBlock;
|
||||||
Block = NULL;
|
Block = NULL;
|
||||||
CFGBlock* RHSBlock = addStmt(C->getRHS(), asc);
|
CFGBlock* RHSBlock = Visit(C->getRHS(), asc);
|
||||||
if (!FinishBlock(RHSBlock))
|
if (!FinishBlock(RHSBlock))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -722,7 +722,7 @@ CFGBlock *CFGBuilder::VisitConditionalOperator(ConditionalOperator *C,
|
||||||
Block = NULL;
|
Block = NULL;
|
||||||
CFGBlock* LHSBlock = NULL;
|
CFGBlock* LHSBlock = NULL;
|
||||||
if (C->getLHS()) {
|
if (C->getLHS()) {
|
||||||
LHSBlock = addStmt(C->getLHS(), asc);
|
LHSBlock = Visit(C->getLHS(), asc);
|
||||||
if (!FinishBlock(LHSBlock))
|
if (!FinishBlock(LHSBlock))
|
||||||
return 0;
|
return 0;
|
||||||
Block = NULL;
|
Block = NULL;
|
||||||
|
@ -730,7 +730,7 @@ CFGBlock *CFGBuilder::VisitConditionalOperator(ConditionalOperator *C,
|
||||||
|
|
||||||
// Create the block for the RHS expression.
|
// Create the block for the RHS expression.
|
||||||
Succ = ConfluenceBlock;
|
Succ = ConfluenceBlock;
|
||||||
CFGBlock* RHSBlock = addStmt(C->getRHS(), asc);
|
CFGBlock* RHSBlock = Visit(C->getRHS(), asc);
|
||||||
if (!FinishBlock(RHSBlock))
|
if (!FinishBlock(RHSBlock))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue