Modified clang driver option -dump-live-variables to (optionally) use the

--analyze-function option to analyze specific functions.

llvm-svn: 47498
This commit is contained in:
Ted Kremenek 2008-02-22 20:13:09 +00:00
parent 88329bf0ea
commit c77f34daad
3 changed files with 6 additions and 4 deletions

View 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);
}
//===----------------------------------------------------------------------===//

View 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);

View 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);