summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/store
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-12-15 10:30:09 +0200
committerNoel Grandin <noel@peralex.com>2015-12-15 10:40:50 +0200
commit00ea9e5e4ef2f20353c881ec5844ed3862897239 (patch)
tree1f6adf8da2d618215131353038ac59ff0a672507 /compilerplugins/clang/store
parent9c9291255f474b396813256050b84ffd425002aa (diff)
update constantfunction loplugin
Change-Id: I7917e5e17e88868a5e315bce11099d32a07ca39e
Diffstat (limited to 'compilerplugins/clang/store')
-rw-r--r--compilerplugins/clang/store/constantfunction.cxx28
1 files changed, 27 insertions, 1 deletions
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<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;
}