forked from OSchip/llvm-project
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:
parent
88329bf0ea
commit
c77f34daad
|
@ -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);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -982,7 +982,7 @@ static ASTConsumer* CreateASTConsumer(const std::string& InFile,
|
|||
AnalyzeSpecificFunction);
|
||||
|
||||
case AnalysisLiveVariables:
|
||||
return CreateLiveVarAnalyzer();
|
||||
return CreateLiveVarAnalyzer(AnalyzeSpecificFunction);
|
||||
|
||||
case WarnDeadStores:
|
||||
return CreateDeadStoreChecker(Diag);
|
||||
|
|
Loading…
Reference in New Issue