summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/sharedvisitor
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-16 12:35:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-16 21:31:07 +0200
commit70c6651e02c4582d66d8e1c1286406c4f01a7d4b (patch)
tree6a49b8cb229f7eed80e9d461fc70da76237c4bb1 /compilerplugins/clang/sharedvisitor
parent08b4e947584d3e3629089cdcec50dd566c5c031c (diff)
convert redundantfcast to LO_CLANG_SHARED_PLUGINS
Change-Id: I8c1c990d91676b33f2fd508025acfa93a66f4950 Reviewed-on: https://gerrit.libreoffice.org/75724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/sharedvisitor')
-rw-r--r--compilerplugins/clang/sharedvisitor/sharedvisitor.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/compilerplugins/clang/sharedvisitor/sharedvisitor.cxx b/compilerplugins/clang/sharedvisitor/sharedvisitor.cxx
index d48343171646..714aa3fd589f 100644
--- a/compilerplugins/clang/sharedvisitor/sharedvisitor.cxx
+++ b/compilerplugins/clang/sharedvisitor/sharedvisitor.cxx
@@ -25,6 +25,7 @@
#include "../inlinevisible.cxx"
#include "../loopvartoosmall.cxx"
#include "../privatebase.cxx"
+#include "../redundantfcast.cxx"
#include "../redundantinline.cxx"
#include "../redundantpointerops.cxx"
#include "../reservedid.cxx"
@@ -77,6 +78,7 @@ public:
, inlineVisible( nullptr )
, loopVarTooSmall( nullptr )
, privateBase( nullptr )
+ , redundantFCast( nullptr )
, redundantInline( nullptr )
, redundantPointerOps( nullptr )
, reservedId( nullptr )
@@ -131,6 +133,8 @@ public:
loopVarTooSmall = nullptr;
if( privateBase && !privateBase->preRun())
privateBase = nullptr;
+ if( redundantFCast && !redundantFCast->preRun())
+ redundantFCast = nullptr;
if( redundantInline && !redundantInline->preRun())
redundantInline = nullptr;
if( redundantPointerOps && !redundantPointerOps->preRun())
@@ -209,6 +213,8 @@ public:
loopVarTooSmall->postRun();
if( privateBase )
privateBase->postRun();
+ if( redundantFCast )
+ redundantFCast->postRun();
if( redundantInline )
redundantInline->postRun();
if( redundantPointerOps )
@@ -293,6 +299,8 @@ public:
loopVarTooSmall = static_cast< LoopVarTooSmall* >( plugin );
else if( strcmp( name, "privatebase" ) == 0 )
privateBase = static_cast< PrivateBase* >( plugin );
+ else if( strcmp( name, "redundantfcast" ) == 0 )
+ redundantFCast = static_cast< RedundantFCast* >( plugin );
else if( strcmp( name, "redundantinline" ) == 0 )
redundantInline = static_cast< RedundantInline* >( plugin );
else if( strcmp( name, "redundantpointerops" ) == 0 )
@@ -446,6 +454,11 @@ public:
{
if( ignoreLocation( arg ))
return true;
+ if( redundantFCast != nullptr )
+ {
+ if( !redundantFCast->VisitCXXConstructExpr( arg ))
+ redundantFCast = nullptr;
+ }
if( simplifyConstruct != nullptr )
{
if( !simplifyConstruct->VisitCXXConstructExpr( arg ))
@@ -468,6 +481,11 @@ public:
{
if( ignoreLocation( arg ))
return true;
+ if( redundantFCast != nullptr )
+ {
+ if( !redundantFCast->VisitCXXFunctionalCastExpr( arg ))
+ redundantFCast = nullptr;
+ }
if( salUnicodeLiteral != nullptr )
{
if( !salUnicodeLiteral->VisitCXXFunctionalCastExpr( arg ))
@@ -586,6 +604,11 @@ public:
if( !dbgUnhandledException->VisitCallExpr( arg ))
dbgUnhandledException = nullptr;
}
+ if( redundantFCast != nullptr )
+ {
+ if( !redundantFCast->VisitCallExpr( arg ))
+ redundantFCast = nullptr;
+ }
if( salLogAreas != nullptr )
{
if( !salLogAreas->VisitCallExpr( arg ))
@@ -815,6 +838,11 @@ public:
{
if( ignoreLocation( arg ))
return true;
+ if( redundantFCast != nullptr )
+ {
+ if( !redundantFCast->VisitReturnStmt( arg ))
+ redundantFCast = nullptr;
+ }
if( stringStatic != nullptr )
{
if( !stringStatic->VisitReturnStmt( arg ))
@@ -1061,6 +1089,7 @@ private:
|| inlineVisible != nullptr
|| loopVarTooSmall != nullptr
|| privateBase != nullptr
+ || redundantFCast != nullptr
|| redundantInline != nullptr
|| redundantPointerOps != nullptr
|| reservedId != nullptr
@@ -1099,6 +1128,7 @@ private:
InlineVisible* inlineVisible;
LoopVarTooSmall* loopVarTooSmall;
PrivateBase* privateBase;
+ RedundantFCast* redundantFCast;
RedundantInline* redundantInline;
RedundantPointerOps* redundantPointerOps;
ReservedId* reservedId;