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
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 2bb4422..dde1c57 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -54,6 +54,7 @@
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 @@
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 @@
case ParseCFGView:
DumpCFGs(PP, MainFileID, Stats, true);
break;
+ case AnalysisLiveVariables:
+ AnalyzeLiveVariables(PP, MainFileID);
+ break;
case EmitLLVM:
EmitLLVMFromASTs(PP, MainFileID, Stats);
break;