forked from OSchip/llvm-project
Remove unused 'AddStmtChoice' argument to CFGBuilder::appendStmt().
llvm-svn: 127386
This commit is contained in:
parent
f9d8290af1
commit
2866bab5fa
|
@ -384,8 +384,7 @@ private:
|
||||||
void addLocalScopeAndDtors(Stmt* S);
|
void addLocalScopeAndDtors(Stmt* S);
|
||||||
|
|
||||||
// Interface to CFGBlock - adding CFGElements.
|
// Interface to CFGBlock - adding CFGElements.
|
||||||
void appendStmt(CFGBlock *B, Stmt *S,
|
void appendStmt(CFGBlock *B, Stmt *S) {
|
||||||
AddStmtChoice asc = AddStmtChoice::AlwaysAdd) {
|
|
||||||
B->appendStmt(S, cfg->getBumpVectorContext());
|
B->appendStmt(S, cfg->getBumpVectorContext());
|
||||||
}
|
}
|
||||||
void appendInitializer(CFGBlock *B, CXXCtorInitializer *I) {
|
void appendInitializer(CFGBlock *B, CXXCtorInitializer *I) {
|
||||||
|
@ -937,7 +936,7 @@ tryAgain:
|
||||||
CFGBlock *CFGBuilder::VisitStmt(Stmt *S, AddStmtChoice asc) {
|
CFGBlock *CFGBuilder::VisitStmt(Stmt *S, AddStmtChoice asc) {
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, S, asc);
|
appendStmt(Block, S);
|
||||||
}
|
}
|
||||||
|
|
||||||
return VisitChildren(S);
|
return VisitChildren(S);
|
||||||
|
@ -960,7 +959,7 @@ CFGBlock *CFGBuilder::VisitAddrLabelExpr(AddrLabelExpr *A,
|
||||||
|
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, A, asc);
|
appendStmt(Block, A);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Block;
|
return Block;
|
||||||
|
@ -970,7 +969,7 @@ CFGBlock *CFGBuilder::VisitUnaryOperator(UnaryOperator *U,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, U, asc);
|
appendStmt(Block, U);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Visit(U->getSubExpr(), AddStmtChoice());
|
return Visit(U->getSubExpr(), AddStmtChoice());
|
||||||
|
@ -980,7 +979,7 @@ CFGBlock *CFGBuilder::VisitBinaryOperator(BinaryOperator *B,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
if (B->isLogicalOp()) { // && or ||
|
if (B->isLogicalOp()) { // && or ||
|
||||||
CFGBlock* ConfluenceBlock = Block ? Block : createBlock();
|
CFGBlock* ConfluenceBlock = Block ? Block : createBlock();
|
||||||
appendStmt(ConfluenceBlock, B, asc);
|
appendStmt(ConfluenceBlock, B);
|
||||||
|
|
||||||
if (badCFG)
|
if (badCFG)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1025,7 +1024,7 @@ CFGBlock *CFGBuilder::VisitBinaryOperator(BinaryOperator *B,
|
||||||
|
|
||||||
if (B->getOpcode() == BO_Comma) { // ,
|
if (B->getOpcode() == BO_Comma) { // ,
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, B, asc);
|
appendStmt(Block, B);
|
||||||
addStmt(B->getRHS());
|
addStmt(B->getRHS());
|
||||||
return addStmt(B->getLHS());
|
return addStmt(B->getLHS());
|
||||||
}
|
}
|
||||||
|
@ -1033,7 +1032,7 @@ CFGBlock *CFGBuilder::VisitBinaryOperator(BinaryOperator *B,
|
||||||
if (B->isAssignmentOp()) {
|
if (B->isAssignmentOp()) {
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, B, asc);
|
appendStmt(Block, B);
|
||||||
}
|
}
|
||||||
Visit(B->getLHS());
|
Visit(B->getLHS());
|
||||||
return Visit(B->getRHS());
|
return Visit(B->getRHS());
|
||||||
|
@ -1041,7 +1040,7 @@ CFGBlock *CFGBuilder::VisitBinaryOperator(BinaryOperator *B,
|
||||||
|
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, B, asc);
|
appendStmt(Block, B);
|
||||||
}
|
}
|
||||||
|
|
||||||
CFGBlock *RBlock = Visit(B->getRHS());
|
CFGBlock *RBlock = Visit(B->getRHS());
|
||||||
|
@ -1055,7 +1054,7 @@ CFGBlock *CFGBuilder::VisitBinaryOperator(BinaryOperator *B,
|
||||||
CFGBlock *CFGBuilder::VisitBlockExpr(BlockExpr *E, AddStmtChoice asc) {
|
CFGBlock *CFGBuilder::VisitBlockExpr(BlockExpr *E, AddStmtChoice asc) {
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, E, asc);
|
appendStmt(Block, E);
|
||||||
}
|
}
|
||||||
return Block;
|
return Block;
|
||||||
}
|
}
|
||||||
|
@ -1133,7 +1132,7 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Block = createBlock(!NoReturn);
|
Block = createBlock(!NoReturn);
|
||||||
appendStmt(Block, C, asc);
|
appendStmt(Block, C);
|
||||||
|
|
||||||
if (NoReturn) {
|
if (NoReturn) {
|
||||||
// Wire this to the exit block directly.
|
// Wire this to the exit block directly.
|
||||||
|
@ -1153,7 +1152,7 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) {
|
||||||
CFGBlock *CFGBuilder::VisitChooseExpr(ChooseExpr *C,
|
CFGBlock *CFGBuilder::VisitChooseExpr(ChooseExpr *C,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
CFGBlock* ConfluenceBlock = Block ? Block : createBlock();
|
CFGBlock* ConfluenceBlock = Block ? Block : createBlock();
|
||||||
appendStmt(ConfluenceBlock, C, asc);
|
appendStmt(ConfluenceBlock, C);
|
||||||
if (badCFG)
|
if (badCFG)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1206,7 +1205,7 @@ CFGBlock *CFGBuilder::VisitConditionalOperator(AbstractConditionalOperator *C,
|
||||||
// Create the confluence block that will "merge" the results of the ternary
|
// Create the confluence block that will "merge" the results of the ternary
|
||||||
// expression.
|
// expression.
|
||||||
CFGBlock* ConfluenceBlock = Block ? Block : createBlock();
|
CFGBlock* ConfluenceBlock = Block ? Block : createBlock();
|
||||||
appendStmt(ConfluenceBlock, C, asc);
|
appendStmt(ConfluenceBlock, C);
|
||||||
if (badCFG)
|
if (badCFG)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1445,7 +1444,7 @@ CFGBlock* CFGBuilder::VisitIfStmt(IfStmt* I) {
|
||||||
if (VarDecl *VD = I->getConditionVariable()) {
|
if (VarDecl *VD = I->getConditionVariable()) {
|
||||||
if (Expr *Init = VD->getInit()) {
|
if (Expr *Init = VD->getInit()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, I, AddStmtChoice::AlwaysAdd);
|
appendStmt(Block, I);
|
||||||
addStmt(Init);
|
addStmt(Init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1583,7 +1582,7 @@ CFGBlock* CFGBuilder::VisitForStmt(ForStmt* F) {
|
||||||
if (VarDecl *VD = F->getConditionVariable()) {
|
if (VarDecl *VD = F->getConditionVariable()) {
|
||||||
if (Expr *Init = VD->getInit()) {
|
if (Expr *Init = VD->getInit()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, F, AddStmtChoice::AlwaysAdd);
|
appendStmt(Block, F);
|
||||||
EntryConditionBlock = addStmt(Init);
|
EntryConditionBlock = addStmt(Init);
|
||||||
assert(Block == EntryConditionBlock);
|
assert(Block == EntryConditionBlock);
|
||||||
}
|
}
|
||||||
|
@ -1683,7 +1682,7 @@ CFGBlock* CFGBuilder::VisitForStmt(ForStmt* F) {
|
||||||
CFGBlock *CFGBuilder::VisitMemberExpr(MemberExpr *M, AddStmtChoice asc) {
|
CFGBlock *CFGBuilder::VisitMemberExpr(MemberExpr *M, AddStmtChoice asc) {
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, M, asc);
|
appendStmt(Block, M);
|
||||||
}
|
}
|
||||||
return Visit(M->getBase());
|
return Visit(M->getBase());
|
||||||
}
|
}
|
||||||
|
@ -1808,7 +1807,7 @@ CFGBlock* CFGBuilder::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt* S) {
|
||||||
|
|
||||||
// Add the @synchronized to the CFG.
|
// Add the @synchronized to the CFG.
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, S, AddStmtChoice::AlwaysAdd);
|
appendStmt(Block, S);
|
||||||
|
|
||||||
// Inline the sync expression.
|
// Inline the sync expression.
|
||||||
return addStmt(S->getSynchExpr());
|
return addStmt(S->getSynchExpr());
|
||||||
|
@ -1867,7 +1866,7 @@ CFGBlock* CFGBuilder::VisitWhileStmt(WhileStmt* W) {
|
||||||
if (VarDecl *VD = W->getConditionVariable()) {
|
if (VarDecl *VD = W->getConditionVariable()) {
|
||||||
if (Expr *Init = VD->getInit()) {
|
if (Expr *Init = VD->getInit()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, W, AddStmtChoice::AlwaysAdd);
|
appendStmt(Block, W);
|
||||||
EntryConditionBlock = addStmt(Init);
|
EntryConditionBlock = addStmt(Init);
|
||||||
assert(Block == EntryConditionBlock);
|
assert(Block == EntryConditionBlock);
|
||||||
}
|
}
|
||||||
|
@ -2226,7 +2225,7 @@ CFGBlock* CFGBuilder::VisitSwitchStmt(SwitchStmt* Terminator) {
|
||||||
if (VarDecl *VD = Terminator->getConditionVariable()) {
|
if (VarDecl *VD = Terminator->getConditionVariable()) {
|
||||||
if (Expr *Init = VD->getInit()) {
|
if (Expr *Init = VD->getInit()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, Terminator, AddStmtChoice::AlwaysAdd);
|
appendStmt(Block, Terminator);
|
||||||
addStmt(Init);
|
addStmt(Init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2474,7 +2473,7 @@ CFGBlock *CFGBuilder::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, E, asc);
|
appendStmt(Block, E);
|
||||||
|
|
||||||
// We do not want to propagate the AlwaysAdd property.
|
// We do not want to propagate the AlwaysAdd property.
|
||||||
asc = asc.withAlwaysAdd(false);
|
asc = asc.withAlwaysAdd(false);
|
||||||
|
@ -2486,7 +2485,7 @@ CFGBlock *CFGBuilder::VisitCXXConstructExpr(CXXConstructExpr *C,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
if (!C->isElidable())
|
if (!C->isElidable())
|
||||||
appendStmt(Block, C, asc.withAlwaysAdd(true));
|
appendStmt(Block, C);
|
||||||
|
|
||||||
return VisitChildren(C);
|
return VisitChildren(C);
|
||||||
}
|
}
|
||||||
|
@ -2495,7 +2494,7 @@ CFGBlock *CFGBuilder::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, E, asc);
|
appendStmt(Block, E);
|
||||||
// We do not want to propagate the AlwaysAdd property.
|
// We do not want to propagate the AlwaysAdd property.
|
||||||
asc = asc.withAlwaysAdd(false);
|
asc = asc.withAlwaysAdd(false);
|
||||||
}
|
}
|
||||||
|
@ -2505,14 +2504,14 @@ CFGBlock *CFGBuilder::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E,
|
||||||
CFGBlock *CFGBuilder::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *C,
|
CFGBlock *CFGBuilder::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *C,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, C, asc.withAlwaysAdd(true));
|
appendStmt(Block, C);
|
||||||
return VisitChildren(C);
|
return VisitChildren(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
CFGBlock *CFGBuilder::VisitCXXMemberCallExpr(CXXMemberCallExpr *C,
|
CFGBlock *CFGBuilder::VisitCXXMemberCallExpr(CXXMemberCallExpr *C,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, C, asc.withAlwaysAdd(true));
|
appendStmt(Block, C);
|
||||||
return VisitChildren(C);
|
return VisitChildren(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2520,7 +2519,7 @@ CFGBlock *CFGBuilder::VisitImplicitCastExpr(ImplicitCastExpr *E,
|
||||||
AddStmtChoice asc) {
|
AddStmtChoice asc) {
|
||||||
if (asc.alwaysAdd()) {
|
if (asc.alwaysAdd()) {
|
||||||
autoCreateBlock();
|
autoCreateBlock();
|
||||||
appendStmt(Block, E, asc);
|
appendStmt(Block, E);
|
||||||
}
|
}
|
||||||
return Visit(E->getSubExpr(), AddStmtChoice());
|
return Visit(E->getSubExpr(), AddStmtChoice());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue