[cfe-commits] r47498 - in /cfe/trunk/Driver: ASTConsumers.cpp ASTConsumers.h clang.cpp
Ted Kremenek
kremenek at apple.com
Fri Feb 22 12:13:09 PST 2008
Author: kremenek
Date: Fri Feb 22 14:13:09 2008
New Revision: 47498
URL: http://llvm.org/viewvc/llvm-project?rev=47498&view=rev
Log:
Modified clang driver option -dump-live-variables to (optionally) use the
--analyze-function option to analyze specific functions.
Modified:
cfe/trunk/Driver/ASTConsumers.cpp
cfe/trunk/Driver/ASTConsumers.h
cfe/trunk/Driver/clang.cpp
Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=47498&r1=47497&r2=47498&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Fri Feb 22 14:13:09 2008
@@ -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);
}
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/Driver/ASTConsumers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.h?rev=47498&r1=47497&r2=47498&view=diff
==============================================================================
--- cfe/trunk/Driver/ASTConsumers.h (original)
+++ cfe/trunk/Driver/ASTConsumers.h Fri Feb 22 14:13:09 2008
@@ -36,7 +36,7 @@
ASTConsumer *CreateCFGDumper(bool ViewGraphs, const std::string& FName);
-ASTConsumer *CreateLiveVarAnalyzer();
+ASTConsumer *CreateLiveVarAnalyzer(const std::string& fname);
ASTConsumer *CreateDeadStoreChecker(Diagnostic &Diags);
Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=47498&r1=47497&r2=47498&view=diff
==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Fri Feb 22 14:13:09 2008
@@ -982,7 +982,7 @@
AnalyzeSpecificFunction);
case AnalysisLiveVariables:
- return CreateLiveVarAnalyzer();
+ return CreateLiveVarAnalyzer(AnalyzeSpecificFunction);
case WarnDeadStores:
return CreateDeadStoreChecker(Diag);
More information about the cfe-commits
mailing list