summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2020-07-06 03:39:12 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-07-10 01:36:07 +0200
commitabb6c01519a0318d7165dc9dc5b7d185353f93d6 (patch)
tree3b6fa1fc13fba77efc13ee3283c3e6c145bd4252 /compilerplugins
parent493ae7a6bb0c3ad50615db0090e7ae8d391bc327 (diff)
replace usage of whitelist with allowlist
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 [API CHANGE] officecfg::Office::Common::Misc::OpenCLWhiteList -> OpenCLAllowList Change-Id: I65636b19b13e4af1e4851f70e78053f3443d6bb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98181 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/bufferadd.cxx2
-rw-r--r--compilerplugins/clang/noexceptmove.cxx4
-rw-r--r--compilerplugins/clang/staticvar.cxx4
-rw-r--r--compilerplugins/clang/store/deletedspecial.cxx76
-rw-r--r--compilerplugins/clang/stringadd.cxx2
-rw-r--r--compilerplugins/clang/test/staticvar.cxx2
-rw-r--r--compilerplugins/clang/test/useuniqueptr.cxx6
-rw-r--r--compilerplugins/clang/unusedvariableplus.cxx2
-rw-r--r--compilerplugins/clang/useuniqueptr.cxx2
-rw-r--r--compilerplugins/clang/vclwidgets.cxx2
-rw-r--r--compilerplugins/clang/weakobject.cxx2
11 files changed, 52 insertions, 52 deletions
diff --git a/compilerplugins/clang/bufferadd.cxx b/compilerplugins/clang/bufferadd.cxx
index ab619f523622..fd32d4874e64 100644
--- a/compilerplugins/clang/bufferadd.cxx
+++ b/compilerplugins/clang/bufferadd.cxx
@@ -342,7 +342,7 @@ bool BufferAdd::isSideEffectFree(Expr const* expr)
if (name == "OUStringToOString" || name == "OStringToOUString")
if (isSideEffectFree(callExpr->getArg(0)))
return true;
- // whitelist some known-safe methods
+ // allowlist some known-safe methods
if (name.endswith("ResId") || name == "GetXMLToken")
if (isSideEffectFree(callExpr->getArg(0)))
return true;
diff --git a/compilerplugins/clang/noexceptmove.cxx b/compilerplugins/clang/noexceptmove.cxx
index b2679024e97b..c2cbdcf0c2a3 100644
--- a/compilerplugins/clang/noexceptmove.cxx
+++ b/compilerplugins/clang/noexceptmove.cxx
@@ -265,7 +265,7 @@ llvm::Optional<bool> NoExceptMove::IsCallThrows(const CallExpr* callExpr)
else
m_CannotFix.back() = true;
}
- // Whitelist of functions that could be noexcept, but we can't change them because of backwards-compatibility reasons
+ // Allowlist of functions that could be noexcept, but we can't change them because of backwards-compatibility reasons
// css::uno::XInterface::acquire
// css::uno::XInterface::release
if (calleeFunctionDecl->getIdentifier())
@@ -305,7 +305,7 @@ llvm::Optional<bool> NoExceptMove::IsCallThrows(const CallExpr* callExpr)
return llvm::Optional<bool>();
}
- // whitelist of functions that could be noexcept, but we can't change them because of backwards-compatibility reasons
+ // allowlist of functions that could be noexcept, but we can't change them because of backwards-compatibility reasons
if (auto typedefType = calleeType->getAs<TypedefType>())
if (typedefType->getDecl()->getName() == "uno_ReleaseMappingFunc")
return false;
diff --git a/compilerplugins/clang/staticvar.cxx b/compilerplugins/clang/staticvar.cxx
index ca1a3b81d37e..10f38f5f71ea 100644
--- a/compilerplugins/clang/staticvar.cxx
+++ b/compilerplugins/clang/staticvar.cxx
@@ -172,11 +172,11 @@ bool StaticVar::VisitVarDecl(VarDecl const* varDecl)
return true;
if (varDecl->isLocalVarDecl())
- report(DiagnosticsEngine::Warning, "var should be static const, or whitelisted",
+ report(DiagnosticsEngine::Warning, "var should be static const, or allowlisted",
varDecl->getLocation())
<< varDecl->getSourceRange();
else
- report(DiagnosticsEngine::Warning, "var should be const, or whitelisted",
+ report(DiagnosticsEngine::Warning, "var should be const, or allowlisted",
varDecl->getLocation())
<< varDecl->getSourceRange();
}
diff --git a/compilerplugins/clang/store/deletedspecial.cxx b/compilerplugins/clang/store/deletedspecial.cxx
index bb6eb5cc6c43..52e717d340e7 100644
--- a/compilerplugins/clang/store/deletedspecial.cxx
+++ b/compilerplugins/clang/store/deletedspecial.cxx
@@ -42,7 +42,7 @@ public:
bool VisitCXXMethodDecl(CXXMethodDecl const * decl);
private:
- bool whitelist(
+ bool allowlist(
CXXMethodDecl const * decl, std::string const & name,
std::string const & path);
};
@@ -64,8 +64,8 @@ bool DeletedSpecial::VisitCXXMethodDecl(CXXMethodDecl const * decl) {
}
std::string desc;
if (decl->isCopyAssignmentOperator()) {
- if (whitelist(decl, "ImpGraphic", "vcl/inc/impgraph.hxx")
- || whitelist(decl, "SwSubFont", "sw/source/core/inc/swfont.hxx"))
+ if (allowlist(decl, "ImpGraphic", "vcl/inc/impgraph.hxx")
+ || allowlist(decl, "SwSubFont", "sw/source/core/inc/swfont.hxx"))
{
return true;
}
@@ -76,24 +76,24 @@ bool DeletedSpecial::VisitCXXMethodDecl(CXXMethodDecl const * decl) {
CXXConstructorDecl const * ctor = dyn_cast<CXXConstructorDecl>(decl);
CXXRecordDecl const * cls = getClass(decl);
if (ctor != nullptr && ctor->isCopyConstructor()) {
- if (whitelist(decl, "ImpGraphic", "vcl/inc/impgraph.hxx")
- || whitelist(decl, "SbMethod", "include/basic/sbmeth.hxx")
- || whitelist(decl, "ScDBCollection::NamedDBs", "sc/inc/dbdata.hxx")
- || whitelist(decl, "ScDrawPage", "sc/inc/drawpage.hxx")
- || whitelist(decl, "SmEditSource", "starmath/source/accessibility.hxx")
- || whitelist(decl, "SwChartDataSequence", "sw/inc/unochart.hxx")
- || whitelist(decl, "SwDPage", "sw/inc/dpage.hxx")
- || whitelist(decl, "SwRedlineExtraData_Format", "sw/inc/redline.hxx")
- || whitelist(decl, "SwRedlineExtraData_FormattingChanges", "sw/inc/redline.hxx")
- || whitelist(decl, "SwTextAPIEditSource", "sw/source/core/inc/textapi.hxx")
- || whitelist(decl, "XclImpBiff5Decrypter", "sc/source/filter/inc/xistream.hxx")
- || whitelist(decl, "XclImpBiff8Decrypter", "sc/source/filter/inc/xistream.hxx")
- || whitelist(decl, "configmgr::LocalizedPropertyNode", "configmgr/source/localizedpropertynode.hxx")
- || whitelist(decl, "configmgr::LocalizedValueNode", "configmgr/source/localizedvaluenode.hxx")
- || whitelist(decl, "configmgr::PropertyNode", "configmgr/source/propertynode.hxx")
- || whitelist(decl, "oox::xls::BiffDecoder_RCF", "sc/source/filter/inc/biffcodec.hxx")
- || whitelist(decl, "oox::xls::BiffDecoder_XOR", "sc/source/filter/inc/biffcodec.hxx")
- || whitelist(decl, "rptui::OReportPage", "reportdesign/inc/RptPage.hxx"))
+ if (allowlist(decl, "ImpGraphic", "vcl/inc/impgraph.hxx")
+ || allowlist(decl, "SbMethod", "include/basic/sbmeth.hxx")
+ || allowlist(decl, "ScDBCollection::NamedDBs", "sc/inc/dbdata.hxx")
+ || allowlist(decl, "ScDrawPage", "sc/inc/drawpage.hxx")
+ || allowlist(decl, "SmEditSource", "starmath/source/accessibility.hxx")
+ || allowlist(decl, "SwChartDataSequence", "sw/inc/unochart.hxx")
+ || allowlist(decl, "SwDPage", "sw/inc/dpage.hxx")
+ || allowlist(decl, "SwRedlineExtraData_Format", "sw/inc/redline.hxx")
+ || allowlist(decl, "SwRedlineExtraData_FormattingChanges", "sw/inc/redline.hxx")
+ || allowlist(decl, "SwTextAPIEditSource", "sw/source/core/inc/textapi.hxx")
+ || allowlist(decl, "XclImpBiff5Decrypter", "sc/source/filter/inc/xistream.hxx")
+ || allowlist(decl, "XclImpBiff8Decrypter", "sc/source/filter/inc/xistream.hxx")
+ || allowlist(decl, "configmgr::LocalizedPropertyNode", "configmgr/source/localizedpropertynode.hxx")
+ || allowlist(decl, "configmgr::LocalizedValueNode", "configmgr/source/localizedvaluenode.hxx")
+ || allowlist(decl, "configmgr::PropertyNode", "configmgr/source/propertynode.hxx")
+ || allowlist(decl, "oox::xls::BiffDecoder_RCF", "sc/source/filter/inc/biffcodec.hxx")
+ || allowlist(decl, "oox::xls::BiffDecoder_XOR", "sc/source/filter/inc/biffcodec.hxx")
+ || allowlist(decl, "rptui::OReportPage", "reportdesign/inc/RptPage.hxx"))
{
return true;
}
@@ -103,22 +103,22 @@ bool DeletedSpecial::VisitCXXMethodDecl(CXXMethodDecl const * decl) {
} else if (ctor != nullptr && ctor->isDefaultConstructor()
&& std::distance(cls->ctor_begin(), cls->ctor_end()) == 1)
{
- if (whitelist(decl, "AquaA11yFocusListener", "vcl/osx/a11yfocuslistener.hxx")
- || whitelist(decl, "DocTemplLocaleHelper", "sfx2/source/doc/doctemplateslocal.hxx")
- || whitelist(decl, "ScViewDataTable", "sc/source/filter/excel/../../ui/inc/viewdata.hxx")
- || whitelist(decl, "ScViewDataTable", "sc/source/ui/inc/viewdata.hxx")
- || whitelist(decl, "SwLineInfo", "sw/source/core/text/inftxt.hxx")
- || whitelist(decl, "XRenderPeer", "vcl/unx/generic/gdi/xrender_peer.hxx")
- || whitelist(decl, "desktop::DispatchWatcher", "desktop/source/app/dispatchwatcher.hxx")
- || whitelist(decl, "desktop::RequestHandler", "desktop/source/app/officeipcthread.hxx")
- || whitelist(decl, "desktop::RequestHandler", "desktop/source/lib/../app/officeipcthread.hxx")
- || whitelist(decl, "sd::DiscoveryService", "sd/source/ui/remotecontrol/DiscoveryService.hxx")
- || whitelist(decl, "sd::IconCache", "sd/source/ui/inc/tools/IconCache.hxx")
- || whitelist(decl, "sd::RemoteServer", "sd/source/ui/inc/RemoteServer.hxx")
- || whitelist(decl, "sd::slidesorter::cache::PageCacheManager", "sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx")
- || whitelist(decl, "framework::CommandInfoProvider", "include/framework/commandinfoprovider.hxx")
- || whitelist(decl, "vcl::SettingsConfigItem", "vcl/inc/configsettings.hxx")
- || whitelist(decl, "writerfilter::ooxml::OOXMLFactory", "writerfilter/source/ooxml/OOXMLFactory.hxx"))
+ if (allowlist(decl, "AquaA11yFocusListener", "vcl/osx/a11yfocuslistener.hxx")
+ || allowlist(decl, "DocTemplLocaleHelper", "sfx2/source/doc/doctemplateslocal.hxx")
+ || allowlist(decl, "ScViewDataTable", "sc/source/filter/excel/../../ui/inc/viewdata.hxx")
+ || allowlist(decl, "ScViewDataTable", "sc/source/ui/inc/viewdata.hxx")
+ || allowlist(decl, "SwLineInfo", "sw/source/core/text/inftxt.hxx")
+ || allowlist(decl, "XRenderPeer", "vcl/unx/generic/gdi/xrender_peer.hxx")
+ || allowlist(decl, "desktop::DispatchWatcher", "desktop/source/app/dispatchwatcher.hxx")
+ || allowlist(decl, "desktop::RequestHandler", "desktop/source/app/officeipcthread.hxx")
+ || allowlist(decl, "desktop::RequestHandler", "desktop/source/lib/../app/officeipcthread.hxx")
+ || allowlist(decl, "sd::DiscoveryService", "sd/source/ui/remotecontrol/DiscoveryService.hxx")
+ || allowlist(decl, "sd::IconCache", "sd/source/ui/inc/tools/IconCache.hxx")
+ || allowlist(decl, "sd::RemoteServer", "sd/source/ui/inc/RemoteServer.hxx")
+ || allowlist(decl, "sd::slidesorter::cache::PageCacheManager", "sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx")
+ || allowlist(decl, "framework::CommandInfoProvider", "include/framework/commandinfoprovider.hxx")
+ || allowlist(decl, "vcl::SettingsConfigItem", "vcl/inc/configsettings.hxx")
+ || allowlist(decl, "writerfilter::ooxml::OOXMLFactory", "writerfilter/source/ooxml/OOXMLFactory.hxx"))
{
return true;
}
@@ -136,7 +136,7 @@ bool DeletedSpecial::VisitCXXMethodDecl(CXXMethodDecl const * decl) {
return true;
}
-bool DeletedSpecial::whitelist(
+bool DeletedSpecial::allowlist(
CXXMethodDecl const * decl, std::string const & name,
std::string const & path)
{
diff --git a/compilerplugins/clang/stringadd.cxx b/compilerplugins/clang/stringadd.cxx
index e9df02bd10c0..288e19c95981 100644
--- a/compilerplugins/clang/stringadd.cxx
+++ b/compilerplugins/clang/stringadd.cxx
@@ -314,7 +314,7 @@ bool StringAdd::isSideEffectFree(Expr const* expr)
if (name == "OUStringToOString" || name == "OStringToOUString")
if (isSideEffectFree(callExpr->getArg(0)))
return true;
- // whitelist some known-safe methods
+ // allowlist some known-safe methods
if (name.endswith("ResId") || name == "GetXMLToken")
if (isSideEffectFree(callExpr->getArg(0)))
return true;
diff --git a/compilerplugins/clang/test/staticvar.cxx b/compilerplugins/clang/test/staticvar.cxx
index 639e6cce46d3..3ae040a2e5a0 100644
--- a/compilerplugins/clang/test/staticvar.cxx
+++ b/compilerplugins/clang/test/staticvar.cxx
@@ -19,7 +19,7 @@ struct S1
S1 const& f1(int a)
{
static S1 s1[]{
- // expected-error@-1 {{var should be static const, or whitelisted [loplugin:staticvar]}}
+ // expected-error@-1 {{var should be static const, or allowlisted [loplugin:staticvar]}}
{ 1, 1 }
};
// no warning expected
diff --git a/compilerplugins/clang/test/useuniqueptr.cxx b/compilerplugins/clang/test/useuniqueptr.cxx
index 3d4f62d5dfa8..f169959d650b 100644
--- a/compilerplugins/clang/test/useuniqueptr.cxx
+++ b/compilerplugins/clang/test/useuniqueptr.cxx
@@ -195,17 +195,17 @@ class Foo14 {
void Foo15(int * p)
{
- delete p; // expected-error {{calling delete on a pointer param, should be either whitelisted or simplified [loplugin:useuniqueptr]}}
+ delete p; // expected-error {{calling delete on a pointer param, should be either allowlisted or simplified [loplugin:useuniqueptr]}}
};
class Foo16 {
Foo16(int * p)
{
- delete p; // expected-error {{calling delete on a pointer param, should be either whitelisted or simplified [loplugin:useuniqueptr]}}
+ delete p; // expected-error {{calling delete on a pointer param, should be either allowlisted or simplified [loplugin:useuniqueptr]}}
};
void foo(int * p)
{
- delete p; // expected-error {{calling delete on a pointer param, should be either whitelisted or simplified [loplugin:useuniqueptr]}}
+ delete p; // expected-error {{calling delete on a pointer param, should be either allowlisted or simplified [loplugin:useuniqueptr]}}
};
};
diff --git a/compilerplugins/clang/unusedvariableplus.cxx b/compilerplugins/clang/unusedvariableplus.cxx
index fa0e9e3992b1..e3e5000d0627 100644
--- a/compilerplugins/clang/unusedvariableplus.cxx
+++ b/compilerplugins/clang/unusedvariableplus.cxx
@@ -15,7 +15,7 @@
#include <unordered_set>
/*
- * Very aggressive unused variable checker, we whitelist types that are known
+ * Very aggressive unused variable checker, we allowlist types that are known
* good when unused.
*/
diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx
index 564e81c442e7..3445510a206d 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -1296,7 +1296,7 @@ void UseUniquePtr::CheckDeleteParmVar(const CXXDeleteExpr* deleteExpr, const Par
*/
report(
DiagnosticsEngine::Warning,
- "calling delete on a pointer param, should be either whitelisted or simplified",
+ "calling delete on a pointer param, should be either allowlisted or simplified",
compat::getBeginLoc(deleteExpr))
<< deleteExpr->getSourceRange();
}
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
index 305defbf014e..61805ff5ad03 100644
--- a/compilerplugins/clang/vclwidgets.cxx
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -366,7 +366,7 @@ bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
return true;
if (loplugin::isSamePathname(aFileName, SRCDIR "/vcl/source/window/layout.cxx"))
return true;
- // whitelist the valid things that can contain pointers.
+ // allowlist the valid things that can contain pointers.
// It is containing stuff like std::unique_ptr we get worried
if (pVarDecl->getType()->isArrayType()) {
return true;
diff --git a/compilerplugins/clang/weakobject.cxx b/compilerplugins/clang/weakobject.cxx
index afa652befc1a..055110ef9331 100644
--- a/compilerplugins/clang/weakobject.cxx
+++ b/compilerplugins/clang/weakobject.cxx
@@ -133,7 +133,7 @@ public:
}
}
- // whitelist
+ // allowlist
auto tc = loplugin::TypeCheck(pMethodDecl->getParent());
if ( tc.Class("OWeakAggObject").Namespace("cppu").GlobalNamespace() // conditional call
|| tc.Class("WeakComponentImplHelperBase").Namespace("cppu").GlobalNamespace() // extra magic