[Libreoffice-commits] core.git: compilerplugins/clang

Noel Grandin noel at peralex.com
Tue Dec 15 00:42:10 PST 2015


 compilerplugins/clang/store/constantfunction.cxx |   28 ++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 00ea9e5e4ef2f20353c881ec5844ed3862897239
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Dec 15 10:30:09 2015 +0200

    update constantfunction loplugin
    
    Change-Id: I7917e5e17e88868a5e315bce11099d32a07ca39e

diff --git a/compilerplugins/clang/store/constantfunction.cxx b/compilerplugins/clang/store/constantfunction.cxx
index c2a4fef..74fc0f4 100644
--- a/compilerplugins/clang/store/constantfunction.cxx
+++ b/compilerplugins/clang/store/constantfunction.cxx
@@ -54,6 +54,18 @@ public:
         if (strstr(compiler.getSourceManager().getFileEntryForID(mainFileID)->getDir()->getName(), "sc/source/core/tool") != 0) {
             return;
         }
+        if (strstr(compiler.getSourceManager().getFileEntryForID(mainFileID)->getDir()->getName(), "sc/source/core/tool") != 0) {
+            return;
+        }
+        if (strstr(compiler.getSourceManager().getFileEntryForID(mainFileID)->getDir()->getName(), "desktop/source/lib") != 0) {
+            return;
+        }
+        if (strstr(compiler.getSourceManager().getFileEntryForID(mainFileID)->getName(), "bootstrapfixture.cxx") != 0) {
+            return;
+        }
+        if (strstr(compiler.getSourceManager().getFileEntryForID(mainFileID)->getName(), "gtk3gtkinst.cxx") != 0) {
+            return;
+        }
 
         TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
     }
@@ -136,6 +148,14 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
     if (getFilename(pFunctionDecl->getCanonicalDecl()->getLocStart()) == SRCDIR "/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx") {
         return true;
     }
+    // this test just test the include of some headers
+    if (aFileName == SRCDIR "/officecfg/qa/cppheader.cxx") {
+        return true;
+    }
+    // just ignore this for now, people furiously hacking in there
+    if (startsWith(aFileName, SRCDIR "/libreofficekit")) {
+        return true;
+    }
 
 
     const CXXMethodDecl *pCXXMethodDecl = dyn_cast<CXXMethodDecl>(pFunctionDecl);
@@ -417,13 +437,19 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
         || aFunctionName == "framework::MenuBarManager::Highlight") {
         return true;
     }
+    if (aFunctionName == "sc::AlignedAllocator::operator!=") {
+        return true;
+    }
+    if (aFunctionName == "clipboard_owner_init") {
+        return true;
+    }
 
     std::string aImmediateMacro = "";
     if (compat::isMacroBodyExpansion(compiler, pFunctionDecl->getLocStart()) ) {
         StringRef name { Lexer::getImmediateMacroName(
                 pFunctionDecl->getLocStart(), compiler.getSourceManager(), compiler.getLangOpts()) };
         aImmediateMacro = name;
-            || name.startswith("IMPL_LINK_") )
+        if (name.startswith("IMPL_LINK_") )
         {
             return true;
         }


More information about the Libreoffice-commits mailing list