Modified clang driver option -dump-live-variables to (optionally) use the
--analyze-function option to analyze specific functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47498 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp
index 316bcd4..fd7768c 100644
--- a/Driver/ASTConsumers.cpp
+++ b/Driver/ASTConsumers.cpp
@@ -516,6 +516,8 @@
class LivenessVisitor : public CFGVisitor {
SourceManager *SM;
public:
+ LivenessVisitor(const std::string& fname) : CFGVisitor(fname) {}
+
virtual void Initialize(ASTContext &Context) {
SM = &Context.getSourceManager();
}
@@ -528,8 +530,8 @@
};
} // end anonymous namespace
-ASTConsumer *clang::CreateLiveVarAnalyzer() {
- return new LivenessVisitor();
+ASTConsumer *clang::CreateLiveVarAnalyzer(const std::string& fname) {
+ return new LivenessVisitor(fname);
}
//===----------------------------------------------------------------------===//