Files
libreoffice/compilerplugins/clang/sharedvisitor/sharedvisitor.cxx
Noel Grandin cc3d75e14c make cppunitassertequals a shared plugin
Change-Id: Ied9c26248cb72f2146fbe1a985f825f7525fa17c
Reviewed-on: https://gerrit.libreoffice.org/75836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19 09:06:25 +02:00

1764 lines
60 KiB
C++

// This file is autogenerated. Do not modify.
// Generated by compilerplugins/clang/sharedvisitor/generator.cxx .
#ifdef LO_CLANG_SHARED_PLUGINS
#include <config_clang.h>
#include <clang/AST/ASTContext.h>
#include <clang/AST/RecursiveASTVisitor.h>
#include "../plugin.hxx"
#undef LO_CLANG_SHARED_PLUGINS // to get sources of individual plugins
#include "../badstatics.cxx"
#include "../blockblock.cxx"
#include "../charrightshift.cxx"
#include "../cppunitassertequals.cxx"
#include "../data.cxx"
#include "../datamembershadow.cxx"
#include "../dbgunhandledexception.cxx"
#include "../derefnullptr.cxx"
#include "../dllprivate.cxx"
#include "../doubleconvert.cxx"
#include "../dynexcspec.cxx"
#include "../empty.cxx"
#include "../emptyif.cxx"
#include "../externandnotdefined.cxx"
#include "../externvar.cxx"
#include "../external.cxx"
#include "../finalprotected.cxx"
#include "../indentation.cxx"
#include "../inlinevisible.cxx"
#include "../intvsfloat.cxx"
#include "../literaltoboolconversion.cxx"
#include "../logexceptionnicely.cxx"
#include "../loopvartoosmall.cxx"
#include "../nestedunnamed.cxx"
#include "../overrideparam.cxx"
#include "../overridevirtual.cxx"
#include "../passparamsbyref.cxx"
#include "../pointerbool.cxx"
#include "../privatebase.cxx"
#include "../rangedforcopy.cxx"
#include "../redundantfcast.cxx"
#include "../redundantinline.cxx"
#include "../redundantpointerops.cxx"
#include "../reservedid.cxx"
#include "../sallogareas.cxx"
#include "../salunicodeliteral.cxx"
#include "../sfxpoolitem.cxx"
#include "../simplifyconstruct.cxx"
#include "../staticaccess.cxx"
#include "../staticanonymous.cxx"
#include "../stringconcat.cxx"
#include "../stringstatic.cxx"
#include "../subtlezeroinit.cxx"
#include "../typedefparam.cxx"
#include "../unicodetochar.cxx"
#include "../unnecessarycatchthrow.cxx"
#include "../unnecessaryoverride.cxx"
#include "../unnecessaryparen.cxx"
#include "../unoany.cxx"
#include "../unoquery.cxx"
#include "../unreffun.cxx"
#include "../unusedvariablecheck.cxx"
#include "../weakbase.cxx"
#include "../weakobject.cxx"
#include "../dyncastvisibility.cxx"
#include "../faileddyncast.cxx"
#include "../ptrvector.cxx"
#include "../vclwidgets.cxx"
using namespace clang;
using namespace llvm;
namespace loplugin
{
class SharedRecursiveASTVisitorBasic
: public FilteringPlugin< SharedRecursiveASTVisitorBasic>
{
public:
explicit SharedRecursiveASTVisitorBasic(const InstantiationData& rData)
: FilteringPlugin(rData)
, badStatics( nullptr )
, blockBlock( nullptr )
, charRightShift( nullptr )
, cppunitAssertEquals( nullptr )
, data( nullptr )
, dataMemberShadow( nullptr )
, dbgUnhandledException( nullptr )
, derefNullPtr( nullptr )
, dllPrivate( nullptr )
, doubleConvert( nullptr )
, dynExcSpec( nullptr )
, empty( nullptr )
, emptyIf( nullptr )
, externAndNotDefined( nullptr )
, externVar( nullptr )
, external( nullptr )
, finalProtected( nullptr )
, indentation( nullptr )
, inlineVisible( nullptr )
, intVsFloat( nullptr )
, literalToBoolConversion( nullptr )
, logExceptionNicely( nullptr )
, loopVarTooSmall( nullptr )
, nestedUnnamed( nullptr )
, overrideParam( nullptr )
, overrideVirtual( nullptr )
, passParamsByRef( nullptr )
, pointerBool( nullptr )
, privateBase( nullptr )
, rangedForCopy( nullptr )
, redundantFCast( nullptr )
, redundantInline( nullptr )
, redundantPointerOps( nullptr )
, reservedId( nullptr )
, salLogAreas( nullptr )
, salUnicodeLiteral( nullptr )
, sfxPoolItem( nullptr )
, simplifyConstruct( nullptr )
, staticAccess( nullptr )
, staticAnonymous( nullptr )
, stringConcat( nullptr )
, stringStatic( nullptr )
, subtleZeroInit( nullptr )
, typedefParam( nullptr )
, unicodeToChar( nullptr )
, unnecessaryCatchThrow( nullptr )
, unnecessaryOverride( nullptr )
, unnecessaryParen( nullptr )
, unoAny( nullptr )
, unoQuery( nullptr )
, unrefFun( nullptr )
, unusedVariableCheck( nullptr )
, weakBase( nullptr )
, weakObject( nullptr )
{}
virtual bool preRun() override
{
if( badStatics && !badStatics->preRun())
badStatics = nullptr;
if( blockBlock && !blockBlock->preRun())
blockBlock = nullptr;
if( charRightShift && !charRightShift->preRun())
charRightShift = nullptr;
if( cppunitAssertEquals && !cppunitAssertEquals->preRun())
cppunitAssertEquals = nullptr;
if( data && !data->preRun())
data = nullptr;
if( dataMemberShadow && !dataMemberShadow->preRun())
dataMemberShadow = nullptr;
if( dbgUnhandledException && !dbgUnhandledException->preRun())
dbgUnhandledException = nullptr;
if( derefNullPtr && !derefNullPtr->preRun())
derefNullPtr = nullptr;
if( dllPrivate && !dllPrivate->preRun())
dllPrivate = nullptr;
if( doubleConvert && !doubleConvert->preRun())
doubleConvert = nullptr;
if( dynExcSpec && !dynExcSpec->preRun())
dynExcSpec = nullptr;
if( empty && !empty->preRun())
empty = nullptr;
if( emptyIf && !emptyIf->preRun())
emptyIf = nullptr;
if( externAndNotDefined && !externAndNotDefined->preRun())
externAndNotDefined = nullptr;
if( externVar && !externVar->preRun())
externVar = nullptr;
if( external && !external->preRun())
external = nullptr;
if( finalProtected && !finalProtected->preRun())
finalProtected = nullptr;
if( indentation && !indentation->preRun())
indentation = nullptr;
if( inlineVisible && !inlineVisible->preRun())
inlineVisible = nullptr;
if( intVsFloat && !intVsFloat->preRun())
intVsFloat = nullptr;
if( literalToBoolConversion && !literalToBoolConversion->preRun())
literalToBoolConversion = nullptr;
if( logExceptionNicely && !logExceptionNicely->preRun())
logExceptionNicely = nullptr;
if( loopVarTooSmall && !loopVarTooSmall->preRun())
loopVarTooSmall = nullptr;
if( nestedUnnamed && !nestedUnnamed->preRun())
nestedUnnamed = nullptr;
if( overrideParam && !overrideParam->preRun())
overrideParam = nullptr;
if( overrideVirtual && !overrideVirtual->preRun())
overrideVirtual = nullptr;
if( passParamsByRef && !passParamsByRef->preRun())
passParamsByRef = nullptr;
if( pointerBool && !pointerBool->preRun())
pointerBool = nullptr;
if( privateBase && !privateBase->preRun())
privateBase = nullptr;
if( rangedForCopy && !rangedForCopy->preRun())
rangedForCopy = nullptr;
if( redundantFCast && !redundantFCast->preRun())
redundantFCast = nullptr;
if( redundantInline && !redundantInline->preRun())
redundantInline = nullptr;
if( redundantPointerOps && !redundantPointerOps->preRun())
redundantPointerOps = nullptr;
if( reservedId && !reservedId->preRun())
reservedId = nullptr;
if( salLogAreas && !salLogAreas->preRun())
salLogAreas = nullptr;
if( salUnicodeLiteral && !salUnicodeLiteral->preRun())
salUnicodeLiteral = nullptr;
if( sfxPoolItem && !sfxPoolItem->preRun())
sfxPoolItem = nullptr;
if( simplifyConstruct && !simplifyConstruct->preRun())
simplifyConstruct = nullptr;
if( staticAccess && !staticAccess->preRun())
staticAccess = nullptr;
if( staticAnonymous && !staticAnonymous->preRun())
staticAnonymous = nullptr;
if( stringConcat && !stringConcat->preRun())
stringConcat = nullptr;
if( stringStatic && !stringStatic->preRun())
stringStatic = nullptr;
if( subtleZeroInit && !subtleZeroInit->preRun())
subtleZeroInit = nullptr;
if( typedefParam && !typedefParam->preRun())
typedefParam = nullptr;
if( unicodeToChar && !unicodeToChar->preRun())
unicodeToChar = nullptr;
if( unnecessaryCatchThrow && !unnecessaryCatchThrow->preRun())
unnecessaryCatchThrow = nullptr;
if( unnecessaryOverride && !unnecessaryOverride->preRun())
unnecessaryOverride = nullptr;
if( unnecessaryParen && !unnecessaryParen->preRun())
unnecessaryParen = nullptr;
if( unoAny && !unoAny->preRun())
unoAny = nullptr;
if( unoQuery && !unoQuery->preRun())
unoQuery = nullptr;
if( unrefFun && !unrefFun->preRun())
unrefFun = nullptr;
if( unusedVariableCheck && !unusedVariableCheck->preRun())
unusedVariableCheck = nullptr;
if( weakBase && !weakBase->preRun())
weakBase = nullptr;
if( weakObject && !weakObject->preRun())
weakObject = nullptr;
return anyPluginActive();
}
virtual void postRun() override
{
if( badStatics )
badStatics->postRun();
if( blockBlock )
blockBlock->postRun();
if( charRightShift )
charRightShift->postRun();
if( cppunitAssertEquals )
cppunitAssertEquals->postRun();
if( data )
data->postRun();
if( dataMemberShadow )
dataMemberShadow->postRun();
if( dbgUnhandledException )
dbgUnhandledException->postRun();
if( derefNullPtr )
derefNullPtr->postRun();
if( dllPrivate )
dllPrivate->postRun();
if( doubleConvert )
doubleConvert->postRun();
if( dynExcSpec )
dynExcSpec->postRun();
if( empty )
empty->postRun();
if( emptyIf )
emptyIf->postRun();
if( externAndNotDefined )
externAndNotDefined->postRun();
if( externVar )
externVar->postRun();
if( external )
external->postRun();
if( finalProtected )
finalProtected->postRun();
if( indentation )
indentation->postRun();
if( inlineVisible )
inlineVisible->postRun();
if( intVsFloat )
intVsFloat->postRun();
if( literalToBoolConversion )
literalToBoolConversion->postRun();
if( logExceptionNicely )
logExceptionNicely->postRun();
if( loopVarTooSmall )
loopVarTooSmall->postRun();
if( nestedUnnamed )
nestedUnnamed->postRun();
if( overrideParam )
overrideParam->postRun();
if( overrideVirtual )
overrideVirtual->postRun();
if( passParamsByRef )
passParamsByRef->postRun();
if( pointerBool )
pointerBool->postRun();
if( privateBase )
privateBase->postRun();
if( rangedForCopy )
rangedForCopy->postRun();
if( redundantFCast )
redundantFCast->postRun();
if( redundantInline )
redundantInline->postRun();
if( redundantPointerOps )
redundantPointerOps->postRun();
if( reservedId )
reservedId->postRun();
if( salLogAreas )
salLogAreas->postRun();
if( salUnicodeLiteral )
salUnicodeLiteral->postRun();
if( sfxPoolItem )
sfxPoolItem->postRun();
if( simplifyConstruct )
simplifyConstruct->postRun();
if( staticAccess )
staticAccess->postRun();
if( staticAnonymous )
staticAnonymous->postRun();
if( stringConcat )
stringConcat->postRun();
if( stringStatic )
stringStatic->postRun();
if( subtleZeroInit )
subtleZeroInit->postRun();
if( typedefParam )
typedefParam->postRun();
if( unicodeToChar )
unicodeToChar->postRun();
if( unnecessaryCatchThrow )
unnecessaryCatchThrow->postRun();
if( unnecessaryOverride )
unnecessaryOverride->postRun();
if( unnecessaryParen )
unnecessaryParen->postRun();
if( unoAny )
unoAny->postRun();
if( unoQuery )
unoQuery->postRun();
if( unrefFun )
unrefFun->postRun();
if( unusedVariableCheck )
unusedVariableCheck->postRun();
if( weakBase )
weakBase->postRun();
if( weakObject )
weakObject->postRun();
}
virtual void run() override {
if (preRun()) {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
postRun();
}
}
enum { isSharedPlugin = true };
virtual bool setSharedPlugin( Plugin* plugin, const char* name ) override
{
if( strcmp( name, "badstatics" ) == 0 )
badStatics = static_cast< BadStatics* >( plugin );
else if( strcmp( name, "blockblock" ) == 0 )
blockBlock = static_cast< BlockBlock* >( plugin );
else if( strcmp( name, "charrightshift" ) == 0 )
charRightShift = static_cast< CharRightShift* >( plugin );
else if( strcmp( name, "cppunitassertequals" ) == 0 )
cppunitAssertEquals = static_cast< CppunitAssertEquals* >( plugin );
else if( strcmp( name, "data" ) == 0 )
data = static_cast< Data* >( plugin );
else if( strcmp( name, "datamembershadow" ) == 0 )
dataMemberShadow = static_cast< DataMemberShadow* >( plugin );
else if( strcmp( name, "dbgunhandledexception" ) == 0 )
dbgUnhandledException = static_cast< DbgUnhandledException* >( plugin );
else if( strcmp( name, "derefnullptr" ) == 0 )
derefNullPtr = static_cast< DerefNullPtr* >( plugin );
else if( strcmp( name, "dllprivate" ) == 0 )
dllPrivate = static_cast< DllPrivate* >( plugin );
else if( strcmp( name, "doubleconvert" ) == 0 )
doubleConvert = static_cast< DoubleConvert* >( plugin );
else if( strcmp( name, "dynexcspec" ) == 0 )
dynExcSpec = static_cast< DynExcSpec* >( plugin );
else if( strcmp( name, "empty" ) == 0 )
empty = static_cast< Empty* >( plugin );
else if( strcmp( name, "emptyif" ) == 0 )
emptyIf = static_cast< EmptyIf* >( plugin );
else if( strcmp( name, "externandnotdefined" ) == 0 )
externAndNotDefined = static_cast< ExternAndNotDefined* >( plugin );
else if( strcmp( name, "externvar" ) == 0 )
externVar = static_cast< ExternVar* >( plugin );
else if( strcmp( name, "external" ) == 0 )
external = static_cast< External* >( plugin );
else if( strcmp( name, "finalprotected" ) == 0 )
finalProtected = static_cast< FinalProtected* >( plugin );
else if( strcmp( name, "indentation" ) == 0 )
indentation = static_cast< Indentation* >( plugin );
else if( strcmp( name, "inlinevisible" ) == 0 )
inlineVisible = static_cast< InlineVisible* >( plugin );
else if( strcmp( name, "intvsfloat" ) == 0 )
intVsFloat = static_cast< IntVsFloat* >( plugin );
else if( strcmp( name, "literaltoboolconversion" ) == 0 )
literalToBoolConversion = static_cast< LiteralToBoolConversion* >( plugin );
else if( strcmp( name, "logexceptionnicely" ) == 0 )
logExceptionNicely = static_cast< LogExceptionNicely* >( plugin );
else if( strcmp( name, "loopvartoosmall" ) == 0 )
loopVarTooSmall = static_cast< LoopVarTooSmall* >( plugin );
else if( strcmp( name, "nestedunnamed" ) == 0 )
nestedUnnamed = static_cast< NestedUnnamed* >( plugin );
else if( strcmp( name, "overrideparam" ) == 0 )
overrideParam = static_cast< OverrideParam* >( plugin );
else if( strcmp( name, "overridevirtual" ) == 0 )
overrideVirtual = static_cast< OverrideVirtual* >( plugin );
else if( strcmp( name, "passparamsbyref" ) == 0 )
passParamsByRef = static_cast< PassParamsByRef* >( plugin );
else if( strcmp( name, "pointerbool" ) == 0 )
pointerBool = static_cast< PointerBool* >( plugin );
else if( strcmp( name, "privatebase" ) == 0 )
privateBase = static_cast< PrivateBase* >( plugin );
else if( strcmp( name, "rangedforcopy" ) == 0 )
rangedForCopy = static_cast< RangedForCopy* >( 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 )
redundantPointerOps = static_cast< RedundantPointerOps* >( plugin );
else if( strcmp( name, "reservedid" ) == 0 )
reservedId = static_cast< ReservedId* >( plugin );
else if( strcmp( name, "sallogareas" ) == 0 )
salLogAreas = static_cast< SalLogAreas* >( plugin );
else if( strcmp( name, "salunicodeliteral" ) == 0 )
salUnicodeLiteral = static_cast< SalUnicodeLiteral* >( plugin );
else if( strcmp( name, "sfxpoolitem" ) == 0 )
sfxPoolItem = static_cast< SfxPoolItem* >( plugin );
else if( strcmp( name, "simplifyconstruct" ) == 0 )
simplifyConstruct = static_cast< SimplifyConstruct* >( plugin );
else if( strcmp( name, "staticaccess" ) == 0 )
staticAccess = static_cast< StaticAccess* >( plugin );
else if( strcmp( name, "staticanonymous" ) == 0 )
staticAnonymous = static_cast< StaticAnonymous* >( plugin );
else if( strcmp( name, "stringconcat" ) == 0 )
stringConcat = static_cast< StringConcat* >( plugin );
else if( strcmp( name, "stringstatic" ) == 0 )
stringStatic = static_cast< StringStatic* >( plugin );
else if( strcmp( name, "subtlezeroinit" ) == 0 )
subtleZeroInit = static_cast< SubtleZeroInit* >( plugin );
else if( strcmp( name, "typedefparam" ) == 0 )
typedefParam = static_cast< TypedefParam* >( plugin );
else if( strcmp( name, "unicodetochar" ) == 0 )
unicodeToChar = static_cast< UnicodeToChar* >( plugin );
else if( strcmp( name, "unnecessarycatchthrow" ) == 0 )
unnecessaryCatchThrow = static_cast< UnnecessaryCatchThrow* >( plugin );
else if( strcmp( name, "unnecessaryoverride" ) == 0 )
unnecessaryOverride = static_cast< UnnecessaryOverride* >( plugin );
else if( strcmp( name, "unnecessaryparen" ) == 0 )
unnecessaryParen = static_cast< UnnecessaryParen* >( plugin );
else if( strcmp( name, "unoany" ) == 0 )
unoAny = static_cast< UnoAny* >( plugin );
else if( strcmp( name, "unoquery" ) == 0 )
unoQuery = static_cast< UnoQuery* >( plugin );
else if( strcmp( name, "unreffun" ) == 0 )
unrefFun = static_cast< UnrefFun* >( plugin );
else if( strcmp( name, "unusedvariablecheck" ) == 0 )
unusedVariableCheck = static_cast< UnusedVariableCheck* >( plugin );
else if( strcmp( name, "weakbase" ) == 0 )
weakBase = static_cast< WeakBase* >( plugin );
else if( strcmp( name, "weakobject" ) == 0 )
weakObject = static_cast< WeakObject* >( plugin );
else
return false;
return true;
}
bool VisitBinAssign(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( passParamsByRef != nullptr )
{
if( !passParamsByRef->VisitBinAssign( arg ))
passParamsByRef = nullptr;
}
return anyPluginActive();
}
bool VisitBinEQ(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( empty != nullptr )
{
if( !empty->VisitBinEQ( arg ))
empty = nullptr;
}
if( intVsFloat != nullptr )
{
if( !intVsFloat->VisitBinEQ( arg ))
intVsFloat = nullptr;
}
return anyPluginActive();
}
bool VisitBinGE(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( empty != nullptr )
{
if( !empty->VisitBinGE( arg ))
empty = nullptr;
}
return anyPluginActive();
}
bool VisitBinGT(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( empty != nullptr )
{
if( !empty->VisitBinGT( arg ))
empty = nullptr;
}
return anyPluginActive();
}
bool VisitBinLE(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( empty != nullptr )
{
if( !empty->VisitBinLE( arg ))
empty = nullptr;
}
return anyPluginActive();
}
bool VisitBinLT(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( empty != nullptr )
{
if( !empty->VisitBinLT( arg ))
empty = nullptr;
}
return anyPluginActive();
}
bool VisitBinNE(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( empty != nullptr )
{
if( !empty->VisitBinNE( arg ))
empty = nullptr;
}
return anyPluginActive();
}
bool VisitBinShr(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( charRightShift != nullptr )
{
if( !charRightShift->VisitBinShr( arg ))
charRightShift = nullptr;
}
return anyPluginActive();
}
bool VisitBinaryConditionalOperator(const class clang::BinaryConditionalOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitBinaryConditionalOperator( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitCStyleCastExpr(const class clang::CStyleCastExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( salUnicodeLiteral != nullptr )
{
if( !salUnicodeLiteral->VisitCStyleCastExpr( arg ))
salUnicodeLiteral = nullptr;
}
return anyPluginActive();
}
bool VisitCXXConstructExpr(const class clang::CXXConstructExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( redundantFCast != nullptr )
{
if( !redundantFCast->VisitCXXConstructExpr( arg ))
redundantFCast = nullptr;
}
if( simplifyConstruct != nullptr )
{
if( !simplifyConstruct->VisitCXXConstructExpr( arg ))
simplifyConstruct = nullptr;
}
return anyPluginActive();
}
bool VisitCXXDeleteExpr(const class clang::CXXDeleteExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitCXXDeleteExpr( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitCXXForRangeStmt(const class clang::CXXForRangeStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( rangedForCopy != nullptr )
{
if( !rangedForCopy->VisitCXXForRangeStmt( arg ))
rangedForCopy = nullptr;
}
return anyPluginActive();
}
bool VisitCXXFunctionalCastExpr(const class clang::CXXFunctionalCastExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( redundantFCast != nullptr )
{
if( !redundantFCast->VisitCXXFunctionalCastExpr( arg ))
redundantFCast = nullptr;
}
if( salUnicodeLiteral != nullptr )
{
if( !salUnicodeLiteral->VisitCXXFunctionalCastExpr( arg ))
salUnicodeLiteral = nullptr;
}
return anyPluginActive();
}
bool VisitCXXMemberCallExpr(const class clang::CXXMemberCallExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( unoQuery != nullptr )
{
if( !unoQuery->VisitCXXMemberCallExpr( arg ))
unoQuery = nullptr;
}
return anyPluginActive();
}
bool VisitCXXMethodDecl(const class clang::CXXMethodDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( finalProtected != nullptr )
{
if( !finalProtected->VisitCXXMethodDecl( arg ))
finalProtected = nullptr;
}
if( overrideParam != nullptr )
{
if( !overrideParam->VisitCXXMethodDecl( arg ))
overrideParam = nullptr;
}
if( overrideVirtual != nullptr )
{
if( !overrideVirtual->VisitCXXMethodDecl( arg ))
overrideVirtual = nullptr;
}
if( typedefParam != nullptr )
{
if( !typedefParam->VisitCXXMethodDecl( arg ))
typedefParam = nullptr;
}
if( unnecessaryOverride != nullptr )
{
if( !unnecessaryOverride->VisitCXXMethodDecl( arg ))
unnecessaryOverride = nullptr;
}
if( weakObject != nullptr )
{
if( !weakObject->VisitCXXMethodDecl( arg ))
weakObject = nullptr;
}
return anyPluginActive();
}
bool VisitCXXNewExpr(const class clang::CXXNewExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( subtleZeroInit != nullptr )
{
if( !subtleZeroInit->VisitCXXNewExpr( arg ))
subtleZeroInit = nullptr;
}
return anyPluginActive();
}
bool VisitCXXOperatorCallExpr(const class clang::CXXOperatorCallExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( logExceptionNicely != nullptr )
{
if( !logExceptionNicely->VisitCXXOperatorCallExpr( arg ))
logExceptionNicely = nullptr;
}
if( passParamsByRef != nullptr )
{
if( !passParamsByRef->VisitCXXOperatorCallExpr( arg ))
passParamsByRef = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitCXXOperatorCallExpr( arg ))
unnecessaryParen = nullptr;
}
if( unoAny != nullptr )
{
if( !unoAny->VisitCXXOperatorCallExpr( arg ))
unoAny = nullptr;
}
return anyPluginActive();
}
bool VisitCXXRecordDecl(const class clang::CXXRecordDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( privateBase != nullptr )
{
if( !privateBase->VisitCXXRecordDecl( arg ))
privateBase = nullptr;
}
if( sfxPoolItem != nullptr )
{
if( !sfxPoolItem->VisitCXXRecordDecl( arg ))
sfxPoolItem = nullptr;
}
if( weakBase != nullptr )
{
if( !weakBase->VisitCXXRecordDecl( arg ))
weakBase = nullptr;
}
return anyPluginActive();
}
bool VisitCXXStaticCastExpr(const class clang::CXXStaticCastExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( salUnicodeLiteral != nullptr )
{
if( !salUnicodeLiteral->VisitCXXStaticCastExpr( arg ))
salUnicodeLiteral = nullptr;
}
return anyPluginActive();
}
bool VisitCXXTryStmt(const class clang::CXXTryStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( unnecessaryCatchThrow != nullptr )
{
if( !unnecessaryCatchThrow->VisitCXXTryStmt( arg ))
unnecessaryCatchThrow = nullptr;
}
return anyPluginActive();
}
bool VisitCallExpr(const class clang::CallExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( cppunitAssertEquals != nullptr )
{
if( !cppunitAssertEquals->VisitCallExpr( arg ))
cppunitAssertEquals = nullptr;
}
if( dbgUnhandledException != nullptr )
{
if( !dbgUnhandledException->VisitCallExpr( arg ))
dbgUnhandledException = nullptr;
}
if( pointerBool != nullptr )
{
if( !pointerBool->VisitCallExpr( arg ))
pointerBool = nullptr;
}
if( redundantFCast != nullptr )
{
if( !redundantFCast->VisitCallExpr( arg ))
redundantFCast = nullptr;
}
if( salLogAreas != nullptr )
{
if( !salLogAreas->VisitCallExpr( arg ))
salLogAreas = nullptr;
}
if( stringConcat != nullptr )
{
if( !stringConcat->VisitCallExpr( arg ))
stringConcat = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitCallExpr( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitCaseStmt(const class clang::CaseStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( blockBlock != nullptr )
{
if( !blockBlock->VisitCaseStmt( arg ))
blockBlock = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitCaseStmt( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitClassTemplateDecl(const class clang::ClassTemplateDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( external != nullptr )
{
if( !external->VisitClassTemplateDecl( arg ))
external = nullptr;
}
return anyPluginActive();
}
bool VisitCompoundStmt(const class clang::CompoundStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( blockBlock != nullptr )
{
if( !blockBlock->VisitCompoundStmt( arg ))
blockBlock = nullptr;
}
if( indentation != nullptr )
{
if( !indentation->VisitCompoundStmt( arg ))
indentation = nullptr;
}
return anyPluginActive();
}
bool VisitConditionalOperator(const class clang::ConditionalOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitConditionalOperator( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitDoStmt(const class clang::DoStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( loopVarTooSmall != nullptr )
{
if( !loopVarTooSmall->VisitDoStmt( arg ))
loopVarTooSmall = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitDoStmt( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitFieldDecl(const class clang::FieldDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( dataMemberShadow != nullptr )
{
if( !dataMemberShadow->VisitFieldDecl( arg ))
dataMemberShadow = nullptr;
}
if( finalProtected != nullptr )
{
if( !finalProtected->VisitFieldDecl( arg ))
finalProtected = nullptr;
}
return anyPluginActive();
}
bool VisitForStmt(const class clang::ForStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( loopVarTooSmall != nullptr )
{
if( !loopVarTooSmall->VisitForStmt( arg ))
loopVarTooSmall = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitForStmt( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitFunctionDecl(const class clang::FunctionDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( dynExcSpec != nullptr )
{
if( !dynExcSpec->VisitFunctionDecl( arg ))
dynExcSpec = nullptr;
}
if( externAndNotDefined != nullptr )
{
if( !externAndNotDefined->VisitFunctionDecl( arg ))
externAndNotDefined = nullptr;
}
if( external != nullptr )
{
if( !external->VisitFunctionDecl( arg ))
external = nullptr;
}
if( inlineVisible != nullptr )
{
if( !inlineVisible->VisitFunctionDecl( arg ))
inlineVisible = nullptr;
}
if( redundantInline != nullptr )
{
if( !redundantInline->VisitFunctionDecl( arg ))
redundantInline = nullptr;
}
if( redundantPointerOps != nullptr )
{
if( !redundantPointerOps->VisitFunctionDecl( arg ))
redundantPointerOps = nullptr;
}
if( salLogAreas != nullptr )
{
if( !salLogAreas->VisitFunctionDecl( arg ))
salLogAreas = nullptr;
}
if( staticAnonymous != nullptr )
{
if( !staticAnonymous->VisitFunctionDecl( arg ))
staticAnonymous = nullptr;
}
if( typedefParam != nullptr )
{
if( !typedefParam->VisitFunctionDecl( arg ))
typedefParam = nullptr;
}
if( unrefFun != nullptr )
{
if( !unrefFun->VisitFunctionDecl( arg ))
unrefFun = nullptr;
}
return anyPluginActive();
}
bool VisitFunctionTemplateDecl(const class clang::FunctionTemplateDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( external != nullptr )
{
if( !external->VisitFunctionTemplateDecl( arg ))
external = nullptr;
}
return anyPluginActive();
}
bool VisitIfStmt(const class clang::IfStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( emptyIf != nullptr )
{
if( !emptyIf->VisitIfStmt( arg ))
emptyIf = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitIfStmt( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitImplicitCastExpr(const class clang::ImplicitCastExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( literalToBoolConversion != nullptr )
{
if( !literalToBoolConversion->VisitImplicitCastExpr( arg ))
literalToBoolConversion = nullptr;
}
if( unicodeToChar != nullptr )
{
if( !unicodeToChar->VisitImplicitCastExpr( arg ))
unicodeToChar = nullptr;
}
return anyPluginActive();
}
bool VisitMaterializeTemporaryExpr(const class clang::MaterializeTemporaryExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( doubleConvert != nullptr )
{
if( !doubleConvert->VisitMaterializeTemporaryExpr( arg ))
doubleConvert = nullptr;
}
return anyPluginActive();
}
bool VisitMemberExpr(const class clang::MemberExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( redundantPointerOps != nullptr )
{
if( !redundantPointerOps->VisitMemberExpr( arg ))
redundantPointerOps = nullptr;
}
if( staticAccess != nullptr )
{
if( !staticAccess->VisitMemberExpr( arg ))
staticAccess = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitMemberExpr( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitNamedDecl(const class clang::NamedDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( dllPrivate != nullptr )
{
if( !dllPrivate->VisitNamedDecl( arg ))
dllPrivate = nullptr;
}
if( reservedId != nullptr )
{
if( !reservedId->VisitNamedDecl( arg ))
reservedId = nullptr;
}
return anyPluginActive();
}
bool VisitNamespaceDecl(const class clang::NamespaceDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( nestedUnnamed != nullptr )
{
if( !nestedUnnamed->VisitNamespaceDecl( arg ))
nestedUnnamed = nullptr;
}
return anyPluginActive();
}
bool VisitParenExpr(const class clang::ParenExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitParenExpr( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitReturnStmt(const class clang::ReturnStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( redundantFCast != nullptr )
{
if( !redundantFCast->VisitReturnStmt( arg ))
redundantFCast = nullptr;
}
if( stringStatic != nullptr )
{
if( !stringStatic->VisitReturnStmt( arg ))
stringStatic = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitReturnStmt( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitSwitchStmt(const class clang::SwitchStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( indentation != nullptr )
{
if( !indentation->VisitSwitchStmt( arg ))
indentation = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitSwitchStmt( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitTagDecl(const class clang::TagDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( external != nullptr )
{
if( !external->VisitTagDecl( arg ))
external = nullptr;
}
return anyPluginActive();
}
bool VisitUnaryDeref(const class clang::UnaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( derefNullPtr != nullptr )
{
if( !derefNullPtr->VisitUnaryDeref( arg ))
derefNullPtr = nullptr;
}
return anyPluginActive();
}
bool VisitUnaryExprOrTypeTraitExpr(const class clang::UnaryExprOrTypeTraitExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitUnaryExprOrTypeTraitExpr( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool VisitUnaryOperator(const class clang::UnaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( data != nullptr )
{
if( !data->VisitUnaryOperator( arg ))
data = nullptr;
}
if( redundantPointerOps != nullptr )
{
if( !redundantPointerOps->VisitUnaryOperator( arg ))
redundantPointerOps = nullptr;
}
return anyPluginActive();
}
bool VisitVarDecl(const class clang::VarDecl *const arg)
{
if( ignoreLocation( arg ))
return true;
if( badStatics != nullptr )
{
if( !badStatics->VisitVarDecl( arg ))
badStatics = nullptr;
}
if( externVar != nullptr )
{
if( !externVar->VisitVarDecl( arg ))
externVar = nullptr;
}
if( external != nullptr )
{
if( !external->VisitVarDecl( arg ))
external = nullptr;
}
if( intVsFloat != nullptr )
{
if( !intVsFloat->VisitVarDecl( arg ))
intVsFloat = nullptr;
}
if( simplifyConstruct != nullptr )
{
if( !simplifyConstruct->VisitVarDecl( arg ))
simplifyConstruct = nullptr;
}
if( stringStatic != nullptr )
{
if( !stringStatic->VisitVarDecl( arg ))
stringStatic = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitVarDecl( arg ))
unnecessaryParen = nullptr;
}
if( unusedVariableCheck != nullptr )
{
if( !unusedVariableCheck->VisitVarDecl( arg ))
unusedVariableCheck = nullptr;
}
return anyPluginActive();
}
bool VisitVarTemplateDecl(const class clang::VarTemplateDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( external != nullptr )
{
if( !external->VisitVarTemplateDecl( arg ))
external = nullptr;
}
return anyPluginActive();
}
bool VisitWhileStmt(const class clang::WhileStmt * arg)
{
if( ignoreLocation( arg ))
return true;
if( loopVarTooSmall != nullptr )
{
if( !loopVarTooSmall->VisitWhileStmt( arg ))
loopVarTooSmall = nullptr;
}
if( unnecessaryParen != nullptr )
{
if( !unnecessaryParen->VisitWhileStmt( arg ))
unnecessaryParen = nullptr;
}
return anyPluginActive();
}
bool TraverseCStyleCastExpr(class clang::CStyleCastExpr * arg)
{
UnicodeToChar* saveUnicodeToChar = unicodeToChar;
if( unicodeToChar != nullptr )
{
if( !unicodeToChar->PreTraverseCStyleCastExpr( arg ))
unicodeToChar = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseCStyleCastExpr( arg );
if( unicodeToChar != nullptr )
{
if( !unicodeToChar->PostTraverseCStyleCastExpr( arg, ret ))
saveUnicodeToChar = nullptr;
}
unicodeToChar = saveUnicodeToChar;
return ret;
}
bool TraverseCXXBindTemporaryExpr(class clang::CXXBindTemporaryExpr * arg)
{
SimplifyConstruct* saveSimplifyConstruct = simplifyConstruct;
if( simplifyConstruct != nullptr )
{
if( !simplifyConstruct->PreTraverseCXXBindTemporaryExpr( arg ))
simplifyConstruct = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseCXXBindTemporaryExpr( arg );
simplifyConstruct = saveSimplifyConstruct;
return ret;
}
bool TraverseCXXCatchStmt(class clang::CXXCatchStmt * arg)
{
DbgUnhandledException* saveDbgUnhandledException = dbgUnhandledException;
if( dbgUnhandledException != nullptr )
{
if( !dbgUnhandledException->PreTraverseCXXCatchStmt( arg ))
dbgUnhandledException = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseCXXCatchStmt( arg );
if( dbgUnhandledException != nullptr )
{
if( !dbgUnhandledException->PostTraverseCXXCatchStmt( arg, ret ))
saveDbgUnhandledException = nullptr;
}
dbgUnhandledException = saveDbgUnhandledException;
return ret;
}
bool TraverseCXXFunctionalCastExpr(class clang::CXXFunctionalCastExpr * arg)
{
UnicodeToChar* saveUnicodeToChar = unicodeToChar;
if( unicodeToChar != nullptr )
{
if( !unicodeToChar->PreTraverseCXXFunctionalCastExpr( arg ))
unicodeToChar = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseCXXFunctionalCastExpr( arg );
if( unicodeToChar != nullptr )
{
if( !unicodeToChar->PostTraverseCXXFunctionalCastExpr( arg, ret ))
saveUnicodeToChar = nullptr;
}
unicodeToChar = saveUnicodeToChar;
return ret;
}
bool TraverseCXXStaticCastExpr(class clang::CXXStaticCastExpr * arg)
{
UnicodeToChar* saveUnicodeToChar = unicodeToChar;
if( unicodeToChar != nullptr )
{
if( !unicodeToChar->PreTraverseCXXStaticCastExpr( arg ))
unicodeToChar = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseCXXStaticCastExpr( arg );
if( unicodeToChar != nullptr )
{
if( !unicodeToChar->PostTraverseCXXStaticCastExpr( arg, ret ))
saveUnicodeToChar = nullptr;
}
unicodeToChar = saveUnicodeToChar;
return ret;
}
bool TraverseFriendDecl(class clang::FriendDecl * arg)
{
UnrefFun* saveUnrefFun = unrefFun;
if( unrefFun != nullptr )
{
if( !unrefFun->PreTraverseFriendDecl( arg ))
unrefFun = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseFriendDecl( arg );
if( unrefFun != nullptr )
{
if( !unrefFun->PostTraverseFriendDecl( arg, ret ))
saveUnrefFun = nullptr;
}
unrefFun = saveUnrefFun;
return ret;
}
bool TraverseFunctionDecl(class clang::FunctionDecl * arg)
{
PassParamsByRef* savePassParamsByRef = passParamsByRef;
if( passParamsByRef != nullptr )
{
if( !passParamsByRef->PreTraverseFunctionDecl( arg ))
passParamsByRef = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseFunctionDecl( arg );
if( passParamsByRef != nullptr )
{
if( !passParamsByRef->PostTraverseFunctionDecl( arg, ret ))
savePassParamsByRef = nullptr;
}
passParamsByRef = savePassParamsByRef;
return ret;
}
bool TraverseImplicitCastExpr(class clang::ImplicitCastExpr * arg)
{
PassParamsByRef* savePassParamsByRef = passParamsByRef;
if( passParamsByRef != nullptr )
{
if( !passParamsByRef->PreTraverseImplicitCastExpr( arg ))
passParamsByRef = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseImplicitCastExpr( arg );
passParamsByRef = savePassParamsByRef;
return ret;
}
bool TraverseInitListExpr(class clang::InitListExpr * arg)
{
SimplifyConstruct* saveSimplifyConstruct = simplifyConstruct;
if( simplifyConstruct != nullptr )
{
if( !simplifyConstruct->PreTraverseInitListExpr( arg ))
simplifyConstruct = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseInitListExpr( arg );
simplifyConstruct = saveSimplifyConstruct;
return ret;
}
bool TraverseLinkageSpecDecl(class clang::LinkageSpecDecl * arg)
{
LiteralToBoolConversion* saveLiteralToBoolConversion = literalToBoolConversion;
if( literalToBoolConversion != nullptr )
{
if( !literalToBoolConversion->PreTraverseLinkageSpecDecl( arg ))
literalToBoolConversion = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseLinkageSpecDecl( arg );
if( literalToBoolConversion != nullptr )
{
if( !literalToBoolConversion->PostTraverseLinkageSpecDecl( arg, ret ))
saveLiteralToBoolConversion = nullptr;
}
literalToBoolConversion = saveLiteralToBoolConversion;
return ret;
}
bool TraverseReturnStmt(class clang::ReturnStmt * arg)
{
SimplifyConstruct* saveSimplifyConstruct = simplifyConstruct;
if( simplifyConstruct != nullptr )
{
if( !simplifyConstruct->PreTraverseReturnStmt( arg ))
simplifyConstruct = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseReturnStmt( arg );
simplifyConstruct = saveSimplifyConstruct;
return ret;
}
bool TraverseSwitchStmt(class clang::SwitchStmt * arg)
{
Indentation* saveIndentation = indentation;
if( indentation != nullptr )
{
if( !indentation->PreTraverseSwitchStmt( arg ))
indentation = nullptr;
}
bool ret = RecursiveASTVisitor::TraverseSwitchStmt( arg );
if( indentation != nullptr )
{
if( !indentation->PostTraverseSwitchStmt( arg, ret ))
saveIndentation = nullptr;
}
indentation = saveIndentation;
return ret;
}
private:
bool anyPluginActive() const
{
return badStatics != nullptr
|| blockBlock != nullptr
|| charRightShift != nullptr
|| cppunitAssertEquals != nullptr
|| data != nullptr
|| dataMemberShadow != nullptr
|| dbgUnhandledException != nullptr
|| derefNullPtr != nullptr
|| dllPrivate != nullptr
|| doubleConvert != nullptr
|| dynExcSpec != nullptr
|| empty != nullptr
|| emptyIf != nullptr
|| externAndNotDefined != nullptr
|| externVar != nullptr
|| external != nullptr
|| finalProtected != nullptr
|| indentation != nullptr
|| inlineVisible != nullptr
|| intVsFloat != nullptr
|| literalToBoolConversion != nullptr
|| logExceptionNicely != nullptr
|| loopVarTooSmall != nullptr
|| nestedUnnamed != nullptr
|| overrideParam != nullptr
|| overrideVirtual != nullptr
|| passParamsByRef != nullptr
|| pointerBool != nullptr
|| privateBase != nullptr
|| rangedForCopy != nullptr
|| redundantFCast != nullptr
|| redundantInline != nullptr
|| redundantPointerOps != nullptr
|| reservedId != nullptr
|| salLogAreas != nullptr
|| salUnicodeLiteral != nullptr
|| sfxPoolItem != nullptr
|| simplifyConstruct != nullptr
|| staticAccess != nullptr
|| staticAnonymous != nullptr
|| stringConcat != nullptr
|| stringStatic != nullptr
|| subtleZeroInit != nullptr
|| typedefParam != nullptr
|| unicodeToChar != nullptr
|| unnecessaryCatchThrow != nullptr
|| unnecessaryOverride != nullptr
|| unnecessaryParen != nullptr
|| unoAny != nullptr
|| unoQuery != nullptr
|| unrefFun != nullptr
|| unusedVariableCheck != nullptr
|| weakBase != nullptr
|| weakObject != nullptr;
}
BadStatics* badStatics;
BlockBlock* blockBlock;
CharRightShift* charRightShift;
CppunitAssertEquals* cppunitAssertEquals;
Data* data;
DataMemberShadow* dataMemberShadow;
DbgUnhandledException* dbgUnhandledException;
DerefNullPtr* derefNullPtr;
DllPrivate* dllPrivate;
DoubleConvert* doubleConvert;
DynExcSpec* dynExcSpec;
Empty* empty;
EmptyIf* emptyIf;
ExternAndNotDefined* externAndNotDefined;
ExternVar* externVar;
External* external;
FinalProtected* finalProtected;
Indentation* indentation;
InlineVisible* inlineVisible;
IntVsFloat* intVsFloat;
LiteralToBoolConversion* literalToBoolConversion;
LogExceptionNicely* logExceptionNicely;
LoopVarTooSmall* loopVarTooSmall;
NestedUnnamed* nestedUnnamed;
OverrideParam* overrideParam;
OverrideVirtual* overrideVirtual;
PassParamsByRef* passParamsByRef;
PointerBool* pointerBool;
PrivateBase* privateBase;
RangedForCopy* rangedForCopy;
RedundantFCast* redundantFCast;
RedundantInline* redundantInline;
RedundantPointerOps* redundantPointerOps;
ReservedId* reservedId;
SalLogAreas* salLogAreas;
SalUnicodeLiteral* salUnicodeLiteral;
SfxPoolItem* sfxPoolItem;
SimplifyConstruct* simplifyConstruct;
StaticAccess* staticAccess;
StaticAnonymous* staticAnonymous;
StringConcat* stringConcat;
StringStatic* stringStatic;
SubtleZeroInit* subtleZeroInit;
TypedefParam* typedefParam;
UnicodeToChar* unicodeToChar;
UnnecessaryCatchThrow* unnecessaryCatchThrow;
UnnecessaryOverride* unnecessaryOverride;
UnnecessaryParen* unnecessaryParen;
UnoAny* unoAny;
UnoQuery* unoQuery;
UnrefFun* unrefFun;
UnusedVariableCheck* unusedVariableCheck;
WeakBase* weakBase;
WeakObject* weakObject;
};
loplugin::Plugin::Registration< SharedRecursiveASTVisitorBasic > registrationBasic("sharedvisitorBasic");
class SharedRecursiveASTVisitorVisitTemplates
: public FilteringPlugin< SharedRecursiveASTVisitorVisitTemplates>
{
public:
explicit SharedRecursiveASTVisitorVisitTemplates(const InstantiationData& rData)
: FilteringPlugin(rData)
, dynCastVisibility( nullptr )
, failedDynCast( nullptr )
, ptrVector( nullptr )
, vCLWidgets( nullptr )
{}
virtual bool preRun() override
{
if( dynCastVisibility && !dynCastVisibility->preRun())
dynCastVisibility = nullptr;
if( failedDynCast && !failedDynCast->preRun())
failedDynCast = nullptr;
if( ptrVector && !ptrVector->preRun())
ptrVector = nullptr;
if( vCLWidgets && !vCLWidgets->preRun())
vCLWidgets = nullptr;
return anyPluginActive();
}
virtual void postRun() override
{
if( dynCastVisibility )
dynCastVisibility->postRun();
if( failedDynCast )
failedDynCast->postRun();
if( ptrVector )
ptrVector->postRun();
if( vCLWidgets )
vCLWidgets->postRun();
}
virtual void run() override {
if (preRun()) {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
postRun();
}
}
enum { isSharedPlugin = true };
virtual bool setSharedPlugin( Plugin* plugin, const char* name ) override
{
if( strcmp( name, "dyncastvisibility" ) == 0 )
dynCastVisibility = static_cast< DynCastVisibility* >( plugin );
else if( strcmp( name, "faileddyncast" ) == 0 )
failedDynCast = static_cast< FailedDynCast* >( plugin );
else if( strcmp( name, "ptrvector" ) == 0 )
ptrVector = static_cast< PtrVector* >( plugin );
else if( strcmp( name, "vclwidgets" ) == 0 )
vCLWidgets = static_cast< VCLWidgets* >( plugin );
else
return false;
return true;
}
bool shouldVisitTemplateInstantiations() const { return true; }
bool VisitBinaryOperator(const class clang::BinaryOperator * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitBinaryOperator( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitCXXConstructExpr(const class clang::CXXConstructExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitCXXConstructExpr( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitCXXDeleteExpr(const class clang::CXXDeleteExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitCXXDeleteExpr( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitCXXDestructorDecl(const class clang::CXXDestructorDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitCXXDestructorDecl( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitCXXDynamicCastExpr(const class clang::CXXDynamicCastExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( dynCastVisibility != nullptr )
{
if( !dynCastVisibility->VisitCXXDynamicCastExpr( arg ))
dynCastVisibility = nullptr;
}
if( failedDynCast != nullptr )
{
if( !failedDynCast->VisitCXXDynamicCastExpr( arg ))
failedDynCast = nullptr;
}
return anyPluginActive();
}
bool VisitCXXOperatorCallExpr(const class clang::CXXOperatorCallExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( ptrVector != nullptr )
{
if( !ptrVector->VisitCXXOperatorCallExpr( arg ))
ptrVector = nullptr;
}
return anyPluginActive();
}
bool VisitCallExpr(const class clang::CallExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitCallExpr( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitDeclRefExpr(const class clang::DeclRefExpr * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitDeclRefExpr( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitFieldDecl(const class clang::FieldDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitFieldDecl( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitFunctionDecl(const class clang::FunctionDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitFunctionDecl( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitParmVarDecl(const class clang::ParmVarDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitParmVarDecl( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
bool VisitVarDecl(const class clang::VarDecl * arg)
{
if( ignoreLocation( arg ))
return true;
if( vCLWidgets != nullptr )
{
if( !vCLWidgets->VisitVarDecl( arg ))
vCLWidgets = nullptr;
}
return anyPluginActive();
}
private:
bool anyPluginActive() const
{
return dynCastVisibility != nullptr
|| failedDynCast != nullptr
|| ptrVector != nullptr
|| vCLWidgets != nullptr;
}
DynCastVisibility* dynCastVisibility;
FailedDynCast* failedDynCast;
PtrVector* ptrVector;
VCLWidgets* vCLWidgets;
};
loplugin::Plugin::Registration< SharedRecursiveASTVisitorVisitTemplates > registrationVisitTemplates("sharedvisitorVisitTemplates");
} // namespace loplugin
#endif // LO_CLANG_SHARED_PLUGINS