aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-03-13 19:32:08 +0000
committerAnna Zaks <ganna@apple.com>2012-03-13 19:32:08 +0000
commita2e589e60d147f4f04cee5682b8389b55c410244 (patch)
tree55be06b5d7ae97bf16e030947d01e665d0460f00 /lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
parentaa5609891df937291bf962dd2fc7deb2ceae292f (diff)
[analyzer] Refactor CallGraph to use Recursive AST visitor when
collecting function Decls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp')
-rw-r--r--lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
index 93a3ab47b9..a97ff4a1cd 100644
--- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -206,9 +206,9 @@ public:
virtual void HandleTranslationUnit(ASTContext &C);
- /// \brief Build the call graph for the context and use it to define the order
+ /// \brief Build the call graph for the TU and use it to define the order
/// in which the functions should be visited.
- void HandleDeclContextGallGraph(ASTContext &C, DeclContext *dc);
+ void HandleDeclsGallGraph(TranslationUnitDecl *TU);
/// \brief Run analyzes(syntax or path sensitive) on the given function.
/// \param Mode - determines if we are requesting syntax only or path
@@ -261,12 +261,11 @@ public:
//===----------------------------------------------------------------------===//
llvm::Timer* AnalysisConsumer::TUTotalTimer = 0;
-void AnalysisConsumer::HandleDeclContextGallGraph(ASTContext &C,
- DeclContext *dc) {
+void AnalysisConsumer::HandleDeclsGallGraph(TranslationUnitDecl *TU) {
// Otherwise, use the Callgraph to derive the order.
// Build the Call Graph.
CallGraph CG;
- CG.addToCallGraph(dc);
+ CG.addToCallGraph(TU);
// Find the top level nodes - children of root + the unreachable (parentless)
// nodes.
@@ -334,7 +333,7 @@ void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
TraverseDecl(TU);
if (Mgr->shouldInlineCall())
- HandleDeclContextGallGraph(C, TU);
+ HandleDeclsGallGraph(TU);
// After all decls handled, run checkers on the entire TranslationUnit.
checkerMgr->runCheckersOnEndOfTranslationUnit(TU, *Mgr, BR);