forked from OSchip/llvm-project
Update CFGStmtVisitor to recognize that ObjCForCollectionStmts are special block-level "expressions".
llvm-svn: 59176
This commit is contained in:
parent
a461e6d124
commit
65dd30fdea
|
@ -68,7 +68,8 @@ public:
|
|||
|
||||
DISPATCH_CASE(StmtExpr)
|
||||
DISPATCH_CASE(ConditionalOperator)
|
||||
|
||||
DISPATCH_CASE(ObjCForCollectionStmt)
|
||||
|
||||
case Stmt::BinaryOperatorClass: {
|
||||
BinaryOperator* B = cast<BinaryOperator>(S);
|
||||
if (B->isLogicalOp())
|
||||
|
@ -90,6 +91,10 @@ public:
|
|||
DEFAULT_BLOCKSTMT_VISIT(StmtExpr)
|
||||
DEFAULT_BLOCKSTMT_VISIT(ConditionalOperator)
|
||||
|
||||
RetTy BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
|
||||
return static_cast<ImplClass*>(this)->BlockStmt_VisitStmt(S);
|
||||
}
|
||||
|
||||
RetTy BlockStmt_VisitImplicitControlFlowExpr(Expr* E) {
|
||||
return static_cast<ImplClass*>(this)->BlockStmt_VisitExpr(E);
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
void VisitBinaryOperator(BinaryOperator* B);
|
||||
void VisitAssign(BinaryOperator* B);
|
||||
void VisitDeclStmt(DeclStmt* DS);
|
||||
void VisitObjCForCollectionStmt(ObjCForCollectionStmt* S);
|
||||
void BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S);
|
||||
void VisitUnaryOperator(UnaryOperator* U);
|
||||
void Visit(Stmt *S);
|
||||
void VisitTerminator(CFGBlock* B);
|
||||
|
@ -176,7 +176,9 @@ void TransferFuncs::VisitBinaryOperator(BinaryOperator* B) {
|
|||
else VisitStmt(B);
|
||||
}
|
||||
|
||||
void TransferFuncs::VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
|
||||
void
|
||||
TransferFuncs::BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
|
||||
|
||||
// This represents a 'use' of the collection.
|
||||
Visit(S->getCollection());
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
bool VisitCallExpr(CallExpr* C);
|
||||
bool VisitDeclStmt(DeclStmt* D);
|
||||
bool VisitConditionalOperator(ConditionalOperator* C);
|
||||
bool VisitObjCForCollectionStmt(ObjCForCollectionStmt* S);
|
||||
bool BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S);
|
||||
|
||||
bool Visit(Stmt *S);
|
||||
bool BlockStmt_VisitExpr(Expr* E);
|
||||
|
@ -180,7 +180,8 @@ bool TransferFuncs::VisitUnaryOperator(UnaryOperator* U) {
|
|||
return Visit(U->getSubExpr());
|
||||
}
|
||||
|
||||
bool TransferFuncs::VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
|
||||
bool
|
||||
TransferFuncs::BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
|
||||
// This represents a use of the 'collection'
|
||||
bool x = Visit(S->getCollection());
|
||||
|
||||
|
|
Loading…
Reference in New Issue