diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-09-20 10:31:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-20 10:31:21 +0200 |
commit | 075489b4b810692edc2ba9910eb3ca659a2b6745 (patch) | |
tree | 42913c853dfeef93a14ccd65d6fa6c9a7f860a13 | |
parent | ee0a0b840763df64ee8940697dbea69c6cccf5e9 (diff) |
Adapt loplugin:dllprivate to DISABLE_DYNLOADING
Change-Id: I721cfeaa144c773ead457e1c9138009d4071a06a
-rw-r--r-- | compilerplugins/clang/dllprivate.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/compilerplugins/clang/dllprivate.cxx b/compilerplugins/clang/dllprivate.cxx index 1acb710c1331..d94ac3a49bd2 100644 --- a/compilerplugins/clang/dllprivate.cxx +++ b/compilerplugins/clang/dllprivate.cxx @@ -57,8 +57,19 @@ public: } private: - void run() override - { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } + void run() override { + // DISABLE_DYNLOADING makes SAL_DLLPUBLIC_{EXPORT,IMPORT,TEMPLAT} expand + // to visibility("hidden") attributes, which would cause bogus warnings + // here (e.g., in UBSan builds that explicitly define DISBALE_DYNLOADING + // in jurt/source/pipe/staticsalhack.cxx); alternatively, change + // include/sal/types.h to make those SAL_DLLPUBLIC_* expand to nothing + // for DISABLE_DYNLOADING: + if (!compiler.getPreprocessor().getIdentifierInfo("DISABLE_DYNLOADING") + ->hasMacroDefinition()) + { + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } + } }; static loplugin::Plugin::Registration<Visitor> reg("dllprivate"); |