diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-22 20:13:09 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-22 20:13:09 +0000 |
commit | bfc10c961212fe2701c717efa134ce9cb55b38cf (patch) | |
tree | 49671e9d69aa91ff95894866b599727522ad7863 | |
parent | 5f39c2dbd4585cff6df5af27d9001750e15cbce5 (diff) |
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
-rw-r--r-- | Driver/ASTConsumers.cpp | 6 | ||||
-rw-r--r-- | Driver/ASTConsumers.h | 2 | ||||
-rw-r--r-- | Driver/clang.cpp | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp index 316bcd4c7b..fd7768cacc 100644 --- a/Driver/ASTConsumers.cpp +++ b/Driver/ASTConsumers.cpp @@ -516,6 +516,8 @@ namespace { 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 @@ namespace { }; } // end anonymous namespace -ASTConsumer *clang::CreateLiveVarAnalyzer() { - return new LivenessVisitor(); +ASTConsumer *clang::CreateLiveVarAnalyzer(const std::string& fname) { + return new LivenessVisitor(fname); } //===----------------------------------------------------------------------===// diff --git a/Driver/ASTConsumers.h b/Driver/ASTConsumers.h index a0745cd792..85940c86f6 100644 --- a/Driver/ASTConsumers.h +++ b/Driver/ASTConsumers.h @@ -36,7 +36,7 @@ ASTConsumer *CreateASTViewer(); ASTConsumer *CreateCFGDumper(bool ViewGraphs, const std::string& FName); -ASTConsumer *CreateLiveVarAnalyzer(); +ASTConsumer *CreateLiveVarAnalyzer(const std::string& fname); ASTConsumer *CreateDeadStoreChecker(Diagnostic &Diags); diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 15384c5f1c..89e0bad4d0 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -982,7 +982,7 @@ static ASTConsumer* CreateASTConsumer(const std::string& InFile, AnalyzeSpecificFunction); case AnalysisLiveVariables: - return CreateLiveVarAnalyzer(); + return CreateLiveVarAnalyzer(AnalyzeSpecificFunction); case WarnDeadStores: return CreateDeadStoreChecker(Diag); |