]> granicus.if.org Git - clang/commitdiff
Modified clang driver option -dump-live-variables to (optionally) use the
authorTed Kremenek <kremenek@apple.com>
Fri, 22 Feb 2008 20:13:09 +0000 (20:13 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 22 Feb 2008 20:13:09 +0000 (20:13 +0000)
--analyze-function option to analyze specific functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47498 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/ASTConsumers.cpp
Driver/ASTConsumers.h
Driver/clang.cpp

index 316bcd4c7bd1274f5ea7485626cb32b04f031c66..fd7768cacc769e7562737edfba8dd99ed6539a4b 100644 (file)
@@ -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);
 }
 
 //===----------------------------------------------------------------------===//
index a0745cd792b9b0c12a1cffd08a69f05072e12b16..85940c86f6f8d6aec18860f67c9fd0b5435599f2 100644 (file)
@@ -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);
 
index 15384c5f1c21c6cbe0e455f851fb9b285ab9c973..89e0bad4d0f39964360ad4309a7abdc3c4cda196 100644 (file)
@@ -982,7 +982,7 @@ static ASTConsumer* CreateASTConsumer(const std::string& InFile,
                              AnalyzeSpecificFunction);
       
     case AnalysisLiveVariables:
-      return CreateLiveVarAnalyzer();
+      return CreateLiveVarAnalyzer(AnalyzeSpecificFunction);
       
     case WarnDeadStores:    
       return CreateDeadStoreChecker(Diag);