Kaydet (Commit) 00ea9e5e authored tarafından Noel Grandin's avatar Noel Grandin

update constantfunction loplugin

Change-Id: I7917e5e17e88868a5e315bce11099d32a07ca39e
üst 9c929125
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment