summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/shouldreturnbool.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-11-11 15:55:49 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-11-11 17:29:06 +0100
commita0c30af2ac83eb0f7e76c336d60a31872db19938 (patch)
treed2a232ef0c5a4812eac1efd7d3580327d2b05872 /compilerplugins/clang/shouldreturnbool.cxx
parent19e96dc1569ea66acb668554daab9bebc6ad973b (diff)
Make base of loplugin::FunctionAddress more flexible
(I'm planning to use it for a FilteringRewritePlugin.) And while at it, base its current uses on FilteringPlugin. Change-Id: I0acdcc6cb0b3a434b425405c8c438dbf65e4d3cb Reviewed-on: https://gerrit.libreoffice.org/82451 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/shouldreturnbool.cxx')
-rw-r--r--compilerplugins/clang/shouldreturnbool.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/compilerplugins/clang/shouldreturnbool.cxx b/compilerplugins/clang/shouldreturnbool.cxx
index a15e9d9b872b..23749d6b6428 100644
--- a/compilerplugins/clang/shouldreturnbool.cxx
+++ b/compilerplugins/clang/shouldreturnbool.cxx
@@ -24,11 +24,12 @@
namespace
{
-class ShouldReturnBool : public loplugin::FunctionAddress<ShouldReturnBool>
+class ShouldReturnBool
+ : public loplugin::FunctionAddress<loplugin::FilteringPlugin<ShouldReturnBool>>
{
public:
explicit ShouldReturnBool(loplugin::InstantiationData const& data)
- : loplugin::FunctionAddress<ShouldReturnBool>(data)
+ : FunctionAddress(data)
{
}
@@ -143,13 +144,13 @@ bool ShouldReturnBool::TraverseFunctionDecl(FunctionDecl* functionDecl)
{
mbInsideFunction = true;
mbFunctionOnlyReturningOneOrZero = true;
- ret = loplugin::FunctionAddress<ShouldReturnBool>::TraverseFunctionDecl(functionDecl);
+ ret = FunctionAddress::TraverseFunctionDecl(functionDecl);
mbInsideFunction = false;
if (mbFunctionOnlyReturningOneOrZero)
problemFunctions.insert(functionDecl);
}
else
- ret = loplugin::FunctionAddress<ShouldReturnBool>::TraverseFunctionDecl(functionDecl);
+ ret = FunctionAddress::TraverseFunctionDecl(functionDecl);
return ret;
}
@@ -160,13 +161,13 @@ bool ShouldReturnBool::TraverseCXXMethodDecl(CXXMethodDecl* methodDecl)
{
mbInsideFunction = true;
mbFunctionOnlyReturningOneOrZero = true;
- ret = loplugin::FunctionAddress<ShouldReturnBool>::TraverseCXXMethodDecl(methodDecl);
+ ret = FunctionAddress::TraverseCXXMethodDecl(methodDecl);
mbInsideFunction = false;
if (mbFunctionOnlyReturningOneOrZero)
problemFunctions.insert(methodDecl);
}
else
- ret = loplugin::FunctionAddress<ShouldReturnBool>::TraverseCXXMethodDecl(methodDecl);
+ ret = FunctionAddress::TraverseCXXMethodDecl(methodDecl);
return ret;
}