Added bandaid support in CFG construction for ObjCForEachStmt and ObjCAtTryStmt:
we gracefully back out and return NULL for the CFG, allowing clients to skip
analyzing functions with these CFGs. We will add support later.
Modified base ASTConsumer "CFGVisitor" to detect when a CFG is not constructed
and to emit a warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48322 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp
index a24cd04..1e40495 100644
--- a/Driver/ASTConsumers.cpp
+++ b/Driver/ASTConsumers.cpp
@@ -482,8 +482,13 @@
}
CFG *C = CFG::buildCFG(FD->getBody());
- VisitCFG(*C, *FD);
- delete C;
+
+ if (C) {
+ VisitCFG(*C, *FD);
+ delete C;
+ }
+ else
+ llvm::cerr << "warning: CFG could not be constructed.\n";
}
//===----------------------------------------------------------------------===//