Skip to content

Commit e8d724f

Browse files
committed
Add export macros to clang_registerCheckers exported by clang analyser plugins
1 parent f88e38a commit e8d724f

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h

+7
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,11 @@ class CheckerRegistry {
196196
} // namespace ento
197197
} // namespace clang
198198

199+
extern "C" {
200+
CLANG_ABI_EXPORT void clang_registerCheckers(clang::ento::CheckerRegistry &registry);
201+
}
202+
203+
#define EXPORT_ANALYZER_API_VERSION() extern "C" const char CLANG_ABI_EXPORT \
204+
clang_analyzerAPIVersionString[] = CLANG_ANALYZER_API_VERSION_STRING
205+
199206
#endif // LLVM_CLANG_STATICANALYZER_FRONTEND_CHECKERREGISTRY_H

clang/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ extern "C" void clang_registerCheckers(CheckerRegistry &registry) {
2424
registry.addDependency("example.DependendentChecker", "example.Dependency");
2525
}
2626

27-
extern "C" const char clang_analyzerAPIVersionString[] =
28-
CLANG_ANALYZER_API_VERSION_STRING;
27+
EXPORT_ANALYZER_API_VERSION();

clang/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ extern "C" void clang_registerCheckers(CheckerRegistry &registry) {
4040
/*DevelopmentStage*/ "released");
4141
}
4242

43-
extern "C" const char clang_analyzerAPIVersionString[] =
44-
CLANG_ANALYZER_API_VERSION_STRING;
43+
EXPORT_ANALYZER_API_VERSION();

clang/lib/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,4 @@ extern "C" void clang_registerCheckers(CheckerRegistry &registry) {
5050
"");
5151
}
5252

53-
extern "C" const char clang_analyzerAPIVersionString[] =
54-
CLANG_ANALYZER_API_VERSION_STRING;
53+
EXPORT_ANALYZER_API_VERSION();

0 commit comments

Comments
 (0)