aboutsummaryrefslogtreecommitdiff
path: root/Driver/clang.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-09-06 00:17:54 +0000
committerTed Kremenek <kremenek@apple.com>2007-09-06 00:17:54 +0000
commite4e633400b1993c1174b47b774fa015220fa695c (patch)
tree8294a4835b7fde277a44e1f891af5489b33a4e00 /Driver/clang.cpp
parentf3a031f47d87cb9925cf8d28eaa26dc81a5dde50 (diff)
Added an early implementation of Live-Variables analysis built on
source-level CFGs. This code may change significantly in the near future as we explore different means to implement dataflow analyses. Added a driver option, -dump-live-variables, to view the output of live variable analysis. This output is very ALPHA; it will be improved shortly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/clang.cpp')
-rw-r--r--Driver/clang.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 2bb4422b75..dde1c5737b 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -54,6 +54,7 @@ enum ProgActions {
ParseAST, // Parse ASTs.
ParseCFGDump, // Parse ASTS. Build CFGs. Print CFGs.
ParseCFGView, // Parse ASTS. Build CFGs. View CFGs (Graphviz).
+ AnalysisLiveVariables, // Print results of live-variable analysis.
ParsePrintCallbacks, // Parse and print each callback.
ParseSyntaxOnly, // Parse and perform semantic analysis.
ParseNoop, // Parse with noop callbacks.
@@ -89,9 +90,11 @@ ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore,
clEnumValN(ParseCFGDump, "dump-cfg",
"Run parser, then build and print CFGs."),
clEnumValN(ParseCFGView, "view-cfg",
- "Run parser, then build and view CFGs with Graphviz."),
+ "Run parser, then build and view CFGs with Graphviz."),
+ clEnumValN(AnalysisLiveVariables, "dump-live-variables",
+ "Run parser and print results of live variable analysis."),
clEnumValN(EmitLLVM, "emit-llvm",
- "Build ASTs then convert to LLVM, emit .ll file"),
+ "Build ASTs then convert to LLVM, emit .ll file"),
clEnumValEnd));
//===----------------------------------------------------------------------===//
@@ -846,6 +849,9 @@ static void ProcessInputFile(Preprocessor &PP, unsigned MainFileID,
case ParseCFGView:
DumpCFGs(PP, MainFileID, Stats, true);
break;
+ case AnalysisLiveVariables:
+ AnalyzeLiveVariables(PP, MainFileID);
+ break;
case EmitLLVM:
EmitLLVMFromASTs(PP, MainFileID, Stats);
break;