Adapt loplugin:dllprivate to DISABLE_DYNLOADING

Change-Id: I721cfeaa144c773ead457e1c9138009d4071a06a
This commit is contained in:
Stephan Bergmann
2016-09-20 10:31:21 +02:00
parent ee0a0b8407
commit 075489b4b8

View File

@@ -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");