summaryrefslogtreecommitdiff
path: root/clang-plugin
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-11-17 11:40:45 +0000
committerPhilip Withnall <philip.withnall@collabora.co.uk>2014-11-17 11:40:45 +0000
commita68acbdf89ea0e79a499555aa51338a035a822d0 (patch)
tree205e195c1f580bb6956cdc08a188c402b485f9ad /clang-plugin
parent33087d072b2179e96577575139303ba6200fbf22 (diff)
plugin: Add support for path-sensitive checkers
Path-sensitive checkers, as opposed to AST checkers, examine all possible run time control flow paths, rather than the structure of the code. The GError checker will be the first of these.
Diffstat (limited to 'clang-plugin')
-rw-r--r--clang-plugin/plugin.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang-plugin/plugin.cpp b/clang-plugin/plugin.cpp
index 280b58b..743a7a6 100644
--- a/clang-plugin/plugin.cpp
+++ b/clang-plugin/plugin.cpp
@@ -23,6 +23,7 @@
#include "config.h"
#include <clang/Frontend/FrontendPluginRegistry.h>
+#include <clang/StaticAnalyzer/Core/CheckerRegistry.h>
#include <clang/AST/AST.h>
#include <clang/AST/ASTConsumer.h>
#include <clang/Frontend/CompilerInstance.h>
@@ -343,8 +344,16 @@ protected:
};
-/* Register the plugin with LLVM. */
+/* Register the AST checkers with LLVM. */
static FrontendPluginRegistry::Add<TartanAction>
X("tartan", "add attributes and warnings using GLib-specific metadata");
+/* Register the path-dependent plugins with Clang. */
+extern "C"
+void clang_registerCheckers (ento::CheckerRegistry &registry) {
+}
+
+extern "C"
+const char clang_analyzerAPIVersionString[] = CLANG_ANALYZER_API_VERSION_STRING;
+
} /* namespace tartan */