aboutsummaryrefslogtreecommitdiff
path: root/Driver/AnalysisConsumer.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-07-02 18:23:21 +0000
committerTed Kremenek <kremenek@apple.com>2008-07-02 18:23:21 +0000
commit902141f74ac3a2cd41966a98cd43e8702bc05ce9 (patch)
tree2c37121118340b35907f1edced32f48f8ef25a6a /Driver/AnalysisConsumer.cpp
parent235e031e84dd9d9aeee554db40e480f14650b527 (diff)
Moved logic for -dump-cfg and -view-cfg into AnalysisConsumer.
Renamed -dump-cfg to -cfg-dump, and -view-cfg to -cfg-view. This naming better matches the same options for asts (e.g. -ast-dump). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/AnalysisConsumer.cpp')
-rw-r--r--Driver/AnalysisConsumer.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/Driver/AnalysisConsumer.cpp b/Driver/AnalysisConsumer.cpp
index ecb4ad23a0..f8d9a250ba 100644
--- a/Driver/AnalysisConsumer.cpp
+++ b/Driver/AnalysisConsumer.cpp
@@ -337,6 +337,16 @@ static void ActionLiveness(AnalysisManager& mgr) {
mgr.getLiveVariables()->dumpBlockLiveness(mgr.getSourceManager());
}
+static void ActionCFGDump(AnalysisManager& mgr) {
+ mgr.DisplayFunction();
+ mgr.getCFG()->dump();
+}
+
+static void ActionCFGView(AnalysisManager& mgr) {
+ mgr.DisplayFunction();
+ mgr.getCFG()->viewCFG();
+}
+
//===----------------------------------------------------------------------===//
// AnalysisConsumer creation.
//===----------------------------------------------------------------------===//
@@ -376,6 +386,14 @@ ASTConsumer* clang::CreateAnalysisConsumer(Analyses* Beg, Analyses* End,
C->addCodeAction(&ActionSimpleChecks);
break;
+ case CFGDump:
+ C->addCodeAction(&ActionCFGDump);
+ break;
+
+ case CFGView:
+ C->addCodeAction(&ActionCFGView);
+ break;
+
default: break;
}