compilerplugins/clang/saloverride.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit a349a4763fd32177be55877a098247959a820c5a
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Thu Dec 18 17:29:31 2014 +0100

    loplugin:saloverride does not make sense for external code
    
    ...where SAL_OVERRIDE is not available
    
    Change-Id: I49d447ba90516f4f744c21302607bff97ad3c4d5

diff --git a/compilerplugins/clang/saloverride.cxx 
b/compilerplugins/clang/saloverride.cxx
index 6b62fb3..bb6766b 100644
--- a/compilerplugins/clang/saloverride.cxx
+++ b/compilerplugins/clang/saloverride.cxx
@@ -25,8 +25,7 @@ class SalOverride:
 public:
     explicit SalOverride(InstantiationData const & data): RewritePlugin(data) 
{}
 
-    virtual void run() override
-    { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+    virtual void run() override;
 
     bool VisitCXXMethodDecl(CXXMethodDecl const * decl);
 
@@ -34,6 +33,14 @@ private:
     std::set<SourceLocation> insertions_;
 };
 
+void SalOverride::run() {
+    if (compiler.getLangOpts().CPlusPlus
+        && compiler.getPreprocessor().getIdentifierInfo(
+            "LIBO_INTERNAL_ONLY")->hasMacroDefinition())
+    {
+        TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+    }
+}
 bool SalOverride::VisitCXXMethodDecl(CXXMethodDecl const * decl) {
     // As a heuristic, ignore declarations where the name is spelled out in an
     // ignored location; that e.g. handles uses of the Q_OBJECT macro from
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to