diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-05-05 03:41:17 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-05-05 03:41:17 +0000 |
commit | 9be6e7ce5788e50c62d40c59b0bbc2ea423683f7 (patch) | |
tree | 464573ac5a8c7cc62962fb935f475e41af3e6c64 /include/clang/StaticAnalyzer/Core/Checker.h | |
parent | ad7ec12ef2edbadb85a3754f0395ef2f06d4256c (diff) |
Add Checker callback for running a checker at the end of processing an entire TranslationUnit. Patch by Lei Zhang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/Checker.h')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/Checker.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/clang/StaticAnalyzer/Core/Checker.h b/include/clang/StaticAnalyzer/Core/Checker.h index 86e30eb523..eb38bd8951 100644 --- a/include/clang/StaticAnalyzer/Core/Checker.h +++ b/include/clang/StaticAnalyzer/Core/Checker.h @@ -63,6 +63,24 @@ public: } }; +class EndOfTranslationUnit { + template <typename CHECKER> + static void _checkEndOfTranslationUnit(void *checker, + const TranslationUnitDecl *TU, + AnalysisManager& mgr, + BugReporter &BR) { + ((const CHECKER *)checker)->checkEndOfTranslationUnit(TU, mgr, BR); + } + +public: + template <typename CHECKER> + static void _register(CHECKER *checker, CheckerManager &mgr){ + mgr._registerForEndOfTranslationUnit( + CheckerManager::CheckEndOfTranslationUnit(checker, + _checkEndOfTranslationUnit<CHECKER>)); + } +}; + template <typename STMT> class PreStmt { template <typename CHECKER> |