diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-12 08:29:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-12 12:57:22 +0200 |
commit | c45bc08dc6e64352e11cf632b8ad868c312a62fe (patch) | |
tree | 4b665726f2a4ffb556e51915dcc5e2515c21d1b7 /compilerplugins | |
parent | 08495e24e899c2fd52b9724d993598189e12fc7e (diff) |
loplugin:stringview whitelist getLength and isEmpty
Change-Id: I38f3410c0b25ff579879b9de1f266af4d8fd51e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150256
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/stringview.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/compilerplugins/clang/stringview.cxx b/compilerplugins/clang/stringview.cxx index b5d533b115cb..d59d1dc68555 100644 --- a/compilerplugins/clang/stringview.cxx +++ b/compilerplugins/clang/stringview.cxx @@ -43,16 +43,9 @@ public: bool preRun() override { auto const fn = handler.getMainFileName(); - return !( - loplugin::isSamePathname(fn, SRCDIR "/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx") - || loplugin::isSamePathname(fn, SRCDIR "/sal/qa/rtl/strings/test_ostring_concat.cxx") - || loplugin::isSamePathname(fn, SRCDIR "/sal/qa/rtl/strings/test_oustring_concat.cxx") - || loplugin::isSamePathname(fn, SRCDIR "/sal/qa/rtl/oustring/rtl_OUString2.cxx") - || loplugin::isSamePathname(fn, SRCDIR "/sal/qa/rtl/strings/test_oustring_compare.cxx") - || loplugin::isSamePathname(fn, - SRCDIR "/sal/qa/rtl/strings/test_oustring_startswith.cxx") - || loplugin::isSamePathname(fn, SRCDIR - "/sal/qa/rtl/strings/test_strings_defaultstringview.cxx")); + return !(loplugin::isSamePathname(fn, SRCDIR "/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx") + || loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/rtl/strings/") + || loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/rtl/oustring/")); } virtual void run() override @@ -368,7 +361,8 @@ bool StringView::VisitCXXMemberCallExpr(CXXMemberCallExpr const* expr) || dc.Function("toDouble") || dc.Function("equalsAscii") || dc.Function("equalsAsciiL") || dc.Function("equalsIgnoreAsciiCase") || dc.Function("compareToIgnoreAsciiCase") || dc.Function("matchIgnoreAsciiCase") || dc.Function("trim") - || dc.Function("startsWith") || dc.Function("endsWith") || dc.Function("match")) + || dc.Function("startsWith") || dc.Function("endsWith") || dc.Function("match") + || dc.Function("isEmpty") || dc.Function("getLength")) { handleSubExprThatCouldBeView(expr->getImplicitObjectArgument()); } |