From 00ea9e5e4ef2f20353c881ec5844ed3862897239 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 15 Dec 2015 10:30:09 +0200 Subject: update constantfunction loplugin Change-Id: I7917e5e17e88868a5e315bce11099d32a07ca39e --- compilerplugins/clang/store/constantfunction.cxx | 28 +++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'compilerplugins/clang/store') diff --git a/compilerplugins/clang/store/constantfunction.cxx b/compilerplugins/clang/store/constantfunction.cxx index c2a4fef2bfe9..74fc0f4669b3 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(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; } -- cgit