Clean away temporarily added using declarations

Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
This commit is contained in:
Stephan Bergmann 2017-11-07 11:50:47 +01:00
parent 07b8711526
commit b35bb38f18
86 changed files with 160 additions and 106 deletions

View File

@ -26,7 +26,7 @@ class AutoMem:
public RecursiveASTVisitor<AutoMem>, public loplugin::Plugin public RecursiveASTVisitor<AutoMem>, public loplugin::Plugin
{ {
public: public:
explicit AutoMem(InstantiationData const & data): Plugin(data), mbInsideDestructor(false) {} explicit AutoMem(loplugin::InstantiationData const & data): Plugin(data), mbInsideDestructor(false) {}
virtual void run() override virtual void run() override
{ {

View File

@ -20,7 +20,8 @@ class BadStatics
{ {
public: public:
explicit BadStatics(InstantiationData const& rData) : Plugin(rData) {} explicit BadStatics(loplugin::InstantiationData const& rData):
Plugin(rData) {}
void run() override { void run() override {
if (compiler.getLangOpts().CPlusPlus) { // no non-trivial dtors in C if (compiler.getLangOpts().CPlusPlus) { // no non-trivial dtors in C

View File

@ -23,7 +23,8 @@ class BlockBlock:
public RecursiveASTVisitor<BlockBlock>, public loplugin::RewritePlugin public RecursiveASTVisitor<BlockBlock>, public loplugin::RewritePlugin
{ {
public: public:
explicit BlockBlock(InstantiationData const & data): RewritePlugin(data) {} explicit BlockBlock(loplugin::InstantiationData const & data):
RewritePlugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -47,7 +47,8 @@ class CastToVoid final:
public RecursiveASTVisitor<CastToVoid>, public loplugin::Plugin public RecursiveASTVisitor<CastToVoid>, public loplugin::Plugin
{ {
public: public:
explicit CastToVoid(InstantiationData const & data): Plugin(data) {} explicit CastToVoid(loplugin::InstantiationData const & data):
Plugin(data) {}
bool TraverseCStyleCastExpr(CStyleCastExpr * expr) { bool TraverseCStyleCastExpr(CStyleCastExpr * expr) {
auto const dre = checkCast(expr); auto const dre = checkCast(expr);

View File

@ -16,7 +16,8 @@ class CharRightShift:
public RecursiveASTVisitor<CharRightShift>, public loplugin::Plugin public RecursiveASTVisitor<CharRightShift>, public loplugin::Plugin
{ {
public: public:
explicit CharRightShift(InstantiationData const & data): Plugin(data) {} explicit CharRightShift(loplugin::InstantiationData const & data):
Plugin(data) {}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -26,7 +26,8 @@ namespace {
class CheckUnusedParams: public RecursiveASTVisitor<CheckUnusedParams>, public loplugin::Plugin { class CheckUnusedParams: public RecursiveASTVisitor<CheckUnusedParams>, public loplugin::Plugin {
public: public:
explicit CheckUnusedParams(InstantiationData const & data): Plugin(data) {} explicit CheckUnusedParams(loplugin::InstantiationData const & data):
Plugin(data) {}
void run() override; void run() override;
bool VisitFunctionDecl(FunctionDecl const *); bool VisitFunctionDecl(FunctionDecl const *);
bool VisitUnaryAddrOf(UnaryOperator const *); bool VisitUnaryAddrOf(UnaryOperator const *);

View File

@ -31,7 +31,8 @@ class CommaOperator:
public RecursiveASTVisitor<CommaOperator>, public loplugin::Plugin public RecursiveASTVisitor<CommaOperator>, public loplugin::Plugin
{ {
public: public:
explicit CommaOperator(InstantiationData const & data): Plugin(data) {} explicit CommaOperator(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -26,7 +26,7 @@ class ComparisonWithConstant :
public RecursiveASTVisitor<ComparisonWithConstant>, public loplugin::RewritePlugin public RecursiveASTVisitor<ComparisonWithConstant>, public loplugin::RewritePlugin
{ {
public: public:
explicit ComparisonWithConstant(InstantiationData const & data): RewritePlugin(data) {} explicit ComparisonWithConstant(loplugin::InstantiationData const & data): RewritePlugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -57,14 +57,14 @@ class ConstantParam:
public loplugin::FunctionAddress<ConstantParam> public loplugin::FunctionAddress<ConstantParam>
{ {
public: public:
explicit ConstantParam(InstantiationData const & data): loplugin::FunctionAddress<ConstantParam>(data) {} explicit ConstantParam(loplugin::InstantiationData const & data): loplugin::FunctionAddress<ConstantParam>(data) {}
virtual void run() override virtual void run() override
{ {
// ignore some files that make clang crash inside EvaluateAsInt // ignore some files that make clang crash inside EvaluateAsInt
std::string fn( compiler.getSourceManager().getFileEntryForID( std::string fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() ); compiler.getSourceManager().getMainFileID())->getName() );
normalizeDotDotInFilePath(fn); loplugin::normalizeDotDotInFilePath(fn);
if (loplugin::isSamePathname(fn, SRCDIR "/basegfx/source/matrix/b2dhommatrix.cxx") if (loplugin::isSamePathname(fn, SRCDIR "/basegfx/source/matrix/b2dhommatrix.cxx")
|| loplugin::isSamePathname(fn, SRCDIR "/basegfx/source/matrix/b3dhommatrix.cxx")) || loplugin::isSamePathname(fn, SRCDIR "/basegfx/source/matrix/b3dhommatrix.cxx"))
return; return;
@ -158,7 +158,7 @@ void ConstantParam::addToCallSet(const FunctionDecl* functionDecl, int paramInde
aInfo.callValue = callValue; aInfo.callValue = callValue;
aInfo.sourceLocation = filename.str() + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); aInfo.sourceLocation = filename.str() + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
normalizeDotDotInFilePath(aInfo.sourceLocation); loplugin::normalizeDotDotInFilePath(aInfo.sourceLocation);
callSet.insert(aInfo); callSet.insert(aInfo);
} }

View File

@ -35,12 +35,12 @@ class ConstParams:
public loplugin::FunctionAddress<ConstParams> public loplugin::FunctionAddress<ConstParams>
{ {
public: public:
explicit ConstParams(InstantiationData const & data): loplugin::FunctionAddress<ConstParams>(data) {} explicit ConstParams(loplugin::InstantiationData const & data): loplugin::FunctionAddress<ConstParams>(data) {}
virtual void run() override { virtual void run() override {
std::string fn( compiler.getSourceManager().getFileEntryForID( std::string fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() ); compiler.getSourceManager().getMainFileID())->getName() );
normalizeDotDotInFilePath(fn); loplugin::normalizeDotDotInFilePath(fn);
if (startswith(fn, SRCDIR "/sal/") if (startswith(fn, SRCDIR "/sal/")
|| fn == SRCDIR "/jurt/source/pipe/staticsalhack.cxx" || fn == SRCDIR "/jurt/source/pipe/staticsalhack.cxx"
|| startswith(fn, SRCDIR "/bridges/") || startswith(fn, SRCDIR "/bridges/")

View File

@ -48,7 +48,8 @@ class ConstStringVar:
public RecursiveASTVisitor<ConstStringVar>, public loplugin::Plugin public RecursiveASTVisitor<ConstStringVar>, public loplugin::Plugin
{ {
public: public:
explicit ConstStringVar(InstantiationData const & data): Plugin(data) {} explicit ConstStringVar(loplugin::InstantiationData const & data):
Plugin(data) {}
void run() override { void run() override {
if (compiler.getLangOpts().CPlusPlus) { if (compiler.getLangOpts().CPlusPlus) {

View File

@ -25,13 +25,14 @@ class ConvertUIntPtr:
public RecursiveASTVisitor<ConvertUIntPtr>, public loplugin::Plugin public RecursiveASTVisitor<ConvertUIntPtr>, public loplugin::Plugin
{ {
public: public:
explicit ConvertUIntPtr(InstantiationData const & data): Plugin(data) {} explicit ConvertUIntPtr(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {
std::string fn( compiler.getSourceManager().getFileEntryForID( std::string fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() ); compiler.getSourceManager().getMainFileID())->getName() );
normalizeDotDotInFilePath(fn); loplugin::normalizeDotDotInFilePath(fn);
// using sal_uIntPtr as in-between type when converting void* to rtl_TextEncoding // using sal_uIntPtr as in-between type when converting void* to rtl_TextEncoding
if (fn == SRCDIR "/sal/osl/unx/thread.cxx") if (fn == SRCDIR "/sal/osl/unx/thread.cxx")
return; return;

View File

@ -59,7 +59,7 @@ class CountUsersOfDefaultParams:
public RecursiveASTVisitor<CountUsersOfDefaultParams>, public loplugin::Plugin public RecursiveASTVisitor<CountUsersOfDefaultParams>, public loplugin::Plugin
{ {
public: public:
explicit CountUsersOfDefaultParams(InstantiationData const & data): Plugin(data) {} explicit CountUsersOfDefaultParams(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override virtual void run() override
{ {
@ -130,7 +130,7 @@ void CountUsersOfDefaultParams::niceName(const FunctionDecl* functionDecl, MyFun
} }
aInfo.sourceLocation = locationToString(functionDecl->getLocation()); aInfo.sourceLocation = locationToString(functionDecl->getLocation());
normalizeDotDotInFilePath(aInfo.sourceLocation); loplugin::normalizeDotDotInFilePath(aInfo.sourceLocation);
} }
bool CountUsersOfDefaultParams::VisitCallExpr(const CallExpr * callExpr) { bool CountUsersOfDefaultParams::VisitCallExpr(const CallExpr * callExpr) {

View File

@ -20,7 +20,8 @@ class CppunitAssertEquals:
public RecursiveASTVisitor<CppunitAssertEquals>, public loplugin::Plugin public RecursiveASTVisitor<CppunitAssertEquals>, public loplugin::Plugin
{ {
public: public:
explicit CppunitAssertEquals(InstantiationData const & data): Plugin(data) {} explicit CppunitAssertEquals(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -86,7 +86,8 @@ class CStyleCast:
public RecursiveASTVisitor<CStyleCast>, public loplugin::Plugin public RecursiveASTVisitor<CStyleCast>, public loplugin::Plugin
{ {
public: public:
explicit CStyleCast(InstantiationData const & data): Plugin(data) {} explicit CStyleCast(loplugin::InstantiationData const & data): Plugin(data)
{}
virtual void run() override { virtual void run() override {
if (compiler.getLangOpts().CPlusPlus) { if (compiler.getLangOpts().CPlusPlus) {

View File

@ -28,7 +28,8 @@ class DataMemberShadow:
public RecursiveASTVisitor<DataMemberShadow>, public loplugin::Plugin public RecursiveASTVisitor<DataMemberShadow>, public loplugin::Plugin
{ {
public: public:
explicit DataMemberShadow(InstantiationData const & data): Plugin(data) {} explicit DataMemberShadow(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override { virtual void run() override {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());

View File

@ -15,7 +15,8 @@ class DerefNullPtr:
public RecursiveASTVisitor<DerefNullPtr>, public loplugin::Plugin public RecursiveASTVisitor<DerefNullPtr>, public loplugin::Plugin
{ {
public: public:
explicit DerefNullPtr(InstantiationData const & data): Plugin(data) {} explicit DerefNullPtr(loplugin::InstantiationData const & data):
Plugin(data) {}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -15,7 +15,8 @@ class DllPrivate final:
public RecursiveASTVisitor<DllPrivate>, public loplugin::Plugin public RecursiveASTVisitor<DllPrivate>, public loplugin::Plugin
{ {
public: public:
explicit DllPrivate(InstantiationData const & data): Plugin(data) {} explicit DllPrivate(loplugin::InstantiationData const & data): Plugin(data)
{}
bool VisitNamedDecl(NamedDecl const * decl) { bool VisitNamedDecl(NamedDecl const * decl) {
if (!decl->getLocation().isInvalid()&&ignoreLocation(decl)) { if (!decl->getLocation().isInvalid()&&ignoreLocation(decl)) {

View File

@ -20,7 +20,8 @@ class DodgySwitch:
public RecursiveASTVisitor<DodgySwitch>, public loplugin::Plugin public RecursiveASTVisitor<DodgySwitch>, public loplugin::Plugin
{ {
public: public:
explicit DodgySwitch(InstantiationData const & data): Plugin(data) {} explicit DodgySwitch(loplugin::InstantiationData const & data): Plugin(data)
{}
virtual void run() override virtual void run() override
{ {

View File

@ -31,13 +31,13 @@ class DropLong:
public RecursiveASTVisitor<DropLong>, public loplugin::Plugin public RecursiveASTVisitor<DropLong>, public loplugin::Plugin
{ {
public: public:
explicit DropLong(InstantiationData const & data): Plugin(data) {} explicit DropLong(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override virtual void run() override
{ {
std::string fn( compiler.getSourceManager().getFileEntryForID( std::string fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() ); compiler.getSourceManager().getMainFileID())->getName() );
normalizeDotDotInFilePath(fn); loplugin::normalizeDotDotInFilePath(fn);
if (startswith(fn, SRCDIR "/sal/")) if (startswith(fn, SRCDIR "/sal/"))
return; return;
if (startswith(fn, SRCDIR "/desktop/unx/")) if (startswith(fn, SRCDIR "/desktop/unx/"))

View File

@ -79,7 +79,8 @@ class DynCastVisibility final:
public RecursiveASTVisitor<DynCastVisibility>, public loplugin::Plugin public RecursiveASTVisitor<DynCastVisibility>, public loplugin::Plugin
{ {
public: public:
explicit DynCastVisibility(InstantiationData const & data): Plugin(data) {} explicit DynCastVisibility(loplugin::InstantiationData const & data):
Plugin(data) {}
bool shouldVisitTemplateInstantiations() const { return true; } bool shouldVisitTemplateInstantiations() const { return true; }

View File

@ -46,7 +46,8 @@ class DynExcSpec:
public RecursiveASTVisitor<DynExcSpec>, public loplugin::RewritePlugin public RecursiveASTVisitor<DynExcSpec>, public loplugin::RewritePlugin
{ {
public: public:
explicit DynExcSpec(InstantiationData const & data): RewritePlugin(data) {} explicit DynExcSpec(loplugin::InstantiationData const & data):
RewritePlugin(data) {}
void run() override { void run() override {
if (compiler.getLangOpts().CPlusPlus) { if (compiler.getLangOpts().CPlusPlus) {

View File

@ -59,7 +59,8 @@ class ExpandableMethods:
public RecursiveASTVisitor<ExpandableMethods>, public loplugin::Plugin public RecursiveASTVisitor<ExpandableMethods>, public loplugin::Plugin
{ {
public: public:
explicit ExpandableMethods(InstantiationData const & data): Plugin(data) {} explicit ExpandableMethods(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {
@ -164,7 +165,7 @@ std::string ExpandableMethods::toString(SourceLocation loc)
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc ); SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc );
StringRef name = compiler.getSourceManager().getFilename(expansionLoc); StringRef name = compiler.getSourceManager().getFilename(expansionLoc);
std::string sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); std::string sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
normalizeDotDotInFilePath(sourceLocation); loplugin::normalizeDotDotInFilePath(sourceLocation);
return sourceLocation; return sourceLocation;
} }

View File

@ -31,13 +31,13 @@ class ExpressionAlwaysZero:
public RecursiveASTVisitor<ExpressionAlwaysZero>, public loplugin::Plugin public RecursiveASTVisitor<ExpressionAlwaysZero>, public loplugin::Plugin
{ {
public: public:
explicit ExpressionAlwaysZero(InstantiationData const & data): Plugin(data) {} explicit ExpressionAlwaysZero(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override virtual void run() override
{ {
std::string fn( compiler.getSourceManager().getFileEntryForID( std::string fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() ); compiler.getSourceManager().getMainFileID())->getName() );
normalizeDotDotInFilePath(fn); loplugin::normalizeDotDotInFilePath(fn);
// encoding of constant value for binary file format // encoding of constant value for binary file format
if (startswith(fn, SRCDIR "/package/source/zipapi/ZipFile.cxx")) if (startswith(fn, SRCDIR "/package/source/zipapi/ZipFile.cxx"))
return; return;

View File

@ -20,7 +20,7 @@ class ExternAndNotDefined:
public RecursiveASTVisitor<ExternAndNotDefined>, public loplugin::Plugin public RecursiveASTVisitor<ExternAndNotDefined>, public loplugin::Plugin
{ {
public: public:
explicit ExternAndNotDefined(InstantiationData const & data): Plugin(data) {} explicit ExternAndNotDefined(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -44,7 +44,8 @@ bool hasExternalLinkage(VarDecl const * decl) {
class ExternVar: public RecursiveASTVisitor<ExternVar>, public loplugin::Plugin class ExternVar: public RecursiveASTVisitor<ExternVar>, public loplugin::Plugin
{ {
public: public:
explicit ExternVar(InstantiationData const & data): Plugin(data) {} explicit ExternVar(loplugin::InstantiationData const & data): Plugin(data)
{}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -93,7 +93,8 @@ class FailedDynCast:
public RecursiveASTVisitor<FailedDynCast>, public loplugin::Plugin public RecursiveASTVisitor<FailedDynCast>, public loplugin::Plugin
{ {
public: public:
explicit FailedDynCast(InstantiationData const & data): Plugin(data) {} explicit FailedDynCast(loplugin::InstantiationData const & data):
Plugin(data) {}
bool shouldVisitTemplateInstantiations() const { return true; } bool shouldVisitTemplateInstantiations() const { return true; }

View File

@ -36,7 +36,8 @@ class FinalClasses:
public RecursiveASTVisitor<FinalClasses>, public loplugin::Plugin public RecursiveASTVisitor<FinalClasses>, public loplugin::Plugin
{ {
public: public:
explicit FinalClasses(InstantiationData const & data): Plugin(data) {} explicit FinalClasses(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -24,7 +24,8 @@ class FinalProtected:
public RecursiveASTVisitor<FinalProtected>, public loplugin::Plugin public RecursiveASTVisitor<FinalProtected>, public loplugin::Plugin
{ {
public: public:
explicit FinalProtected(InstantiationData const & data): Plugin(data) {} explicit FinalProtected(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override { virtual void run() override {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());

View File

@ -24,7 +24,8 @@ class Flatten:
public RecursiveASTVisitor<Flatten>, public loplugin::RewritePlugin public RecursiveASTVisitor<Flatten>, public loplugin::RewritePlugin
{ {
public: public:
explicit Flatten(InstantiationData const & data): RewritePlugin(data) {} explicit Flatten(loplugin::InstantiationData const & data):
RewritePlugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -26,7 +26,8 @@ class FpComparison:
public RecursiveASTVisitor<FpComparison>, public loplugin::Plugin public RecursiveASTVisitor<FpComparison>, public loplugin::Plugin
{ {
public: public:
explicit FpComparison(InstantiationData const & data): Plugin(data) {} explicit FpComparison(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -25,7 +25,8 @@ class FragileDestructor:
public RecursiveASTVisitor<FragileDestructor>, public loplugin::Plugin public RecursiveASTVisitor<FragileDestructor>, public loplugin::Plugin
{ {
public: public:
explicit FragileDestructor(InstantiationData const & data): Plugin(data) {} explicit FragileDestructor(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -79,7 +79,7 @@ class GetImplementationName:
public loplugin::Plugin public loplugin::Plugin
{ {
public: public:
explicit GetImplementationName(InstantiationData const & data) explicit GetImplementationName(loplugin::InstantiationData const & data)
: Plugin(data) : Plugin(data)
, m_Outdir(initOutdir()) , m_Outdir(initOutdir())
, m_OutdirCreated(false) , m_OutdirCreated(false)

View File

@ -234,7 +234,7 @@ class ImplicitBoolConversion:
public RecursiveASTVisitor<ImplicitBoolConversion>, public loplugin::Plugin public RecursiveASTVisitor<ImplicitBoolConversion>, public loplugin::Plugin
{ {
public: public:
explicit ImplicitBoolConversion(InstantiationData const & data): explicit ImplicitBoolConversion(loplugin::InstantiationData const & data):
Plugin(data) {} Plugin(data) {}
virtual void run() override virtual void run() override

View File

@ -14,7 +14,8 @@ namespace {
class IncludeForm final: public PPCallbacks, public loplugin::RewritePlugin { class IncludeForm final: public PPCallbacks, public loplugin::RewritePlugin {
public: public:
explicit IncludeForm(InstantiationData const & data): RewritePlugin(data) explicit IncludeForm(loplugin::InstantiationData const & data):
RewritePlugin(data)
{ compat::addPPCallbacks(compiler.getPreprocessor(), this); } { compat::addPPCallbacks(compiler.getPreprocessor(), this); }
private: private:

View File

@ -65,7 +65,8 @@ class InlineFields:
public RecursiveASTVisitor<InlineFields>, public loplugin::Plugin public RecursiveASTVisitor<InlineFields>, public loplugin::Plugin
{ {
public: public:
explicit InlineFields(InstantiationData const & data): Plugin(data) {} explicit InlineFields(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {
@ -120,7 +121,7 @@ MyFieldInfo InlineFields::niceName(const FieldDecl* fieldDecl)
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( fieldDecl->getLocation() ); SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( fieldDecl->getLocation() );
StringRef name = compiler.getSourceManager().getFilename(expansionLoc); StringRef name = compiler.getSourceManager().getFilename(expansionLoc);
aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
normalizeDotDotInFilePath(aInfo.sourceLocation); loplugin::normalizeDotDotInFilePath(aInfo.sourceLocation);
return aInfo; return aInfo;
} }

View File

@ -21,7 +21,7 @@ class InlineSimpleMemberFunctions:
public RecursiveASTVisitor<InlineSimpleMemberFunctions>, public loplugin::RewritePlugin public RecursiveASTVisitor<InlineSimpleMemberFunctions>, public loplugin::RewritePlugin
{ {
public: public:
explicit InlineSimpleMemberFunctions(InstantiationData const & data): RewritePlugin(data) {} explicit InlineSimpleMemberFunctions(loplugin::InstantiationData const & data): RewritePlugin(data) {}
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -21,7 +21,8 @@ class InlineVisible:
public RecursiveASTVisitor<InlineVisible>, public loplugin::Plugin public RecursiveASTVisitor<InlineVisible>, public loplugin::Plugin
{ {
public: public:
explicit InlineVisible(InstantiationData const & data): Plugin(data) {} explicit InlineVisible(loplugin::InstantiationData const & data):
Plugin(data) {}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -21,7 +21,7 @@ class LiteralToBoolConversion:
public loplugin::RewritePlugin public loplugin::RewritePlugin
{ {
public: public:
explicit LiteralToBoolConversion(InstantiationData const & data): explicit LiteralToBoolConversion(loplugin::InstantiationData const & data):
RewritePlugin(data) {} RewritePlugin(data) {}
virtual void run() override virtual void run() override

View File

@ -26,7 +26,8 @@ class LoopVarTooSmall:
public RecursiveASTVisitor<LoopVarTooSmall>, public loplugin::Plugin public RecursiveASTVisitor<LoopVarTooSmall>, public loplugin::Plugin
{ {
public: public:
explicit LoopVarTooSmall(InstantiationData const & data): Plugin(data) {} explicit LoopVarTooSmall(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override { virtual void run() override {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());

View File

@ -25,7 +25,7 @@ class MemoryVar:
public RecursiveASTVisitor<MemoryVar>, public loplugin::Plugin public RecursiveASTVisitor<MemoryVar>, public loplugin::Plugin
{ {
public: public:
explicit MemoryVar(InstantiationData const & data): Plugin(data), mbChecking(false) {} explicit MemoryVar(loplugin::InstantiationData const & data): Plugin(data), mbChecking(false) {}
virtual void run() override { virtual void run() override {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());

View File

@ -50,7 +50,8 @@ class MergeClasses:
public RecursiveASTVisitor<MergeClasses>, public loplugin::Plugin public RecursiveASTVisitor<MergeClasses>, public loplugin::Plugin
{ {
public: public:
explicit MergeClasses(InstantiationData const & data): Plugin(data) {} explicit MergeClasses(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -54,7 +54,8 @@ class Nullptr:
public RecursiveASTVisitor<Nullptr>, public loplugin::RewritePlugin public RecursiveASTVisitor<Nullptr>, public loplugin::RewritePlugin
{ {
public: public:
explicit Nullptr(InstantiationData const & data): RewritePlugin(data) {} explicit Nullptr(loplugin::InstantiationData const & data):
RewritePlugin(data) {}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -79,13 +79,13 @@ class OnceVar:
public RecursiveASTVisitor<OnceVar>, public loplugin::Plugin public RecursiveASTVisitor<OnceVar>, public loplugin::Plugin
{ {
public: public:
explicit OnceVar(InstantiationData const & data): Plugin(data) {} explicit OnceVar(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override { virtual void run() override {
// ignore some files with problematic macros // ignore some files with problematic macros
std::string fn( compiler.getSourceManager().getFileEntryForID( std::string fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() ); compiler.getSourceManager().getMainFileID())->getName() );
normalizeDotDotInFilePath(fn); loplugin::normalizeDotDotInFilePath(fn);
// platform-specific stuff // platform-specific stuff
if (fn == SRCDIR "/sal/osl/unx/thread.cxx" if (fn == SRCDIR "/sal/osl/unx/thread.cxx"
|| fn == SRCDIR "/sot/source/base/formats.cxx" || fn == SRCDIR "/sot/source/base/formats.cxx"

View File

@ -16,7 +16,7 @@ namespace {
class OslEndian: public loplugin::Plugin, public PPCallbacks { class OslEndian: public loplugin::Plugin, public PPCallbacks {
public: public:
explicit OslEndian(InstantiationData const & data): Plugin(data) { explicit OslEndian(loplugin::InstantiationData const & data): Plugin(data) {
compat::addPPCallbacks(compiler.getPreprocessor(), this); compat::addPPCallbacks(compiler.getPreprocessor(), this);
} }

View File

@ -23,7 +23,8 @@ class Override:
public RecursiveASTVisitor<Override>, public loplugin::RewritePlugin public RecursiveASTVisitor<Override>, public loplugin::RewritePlugin
{ {
public: public:
explicit Override(InstantiationData const & data): RewritePlugin(data) {} explicit Override(loplugin::InstantiationData const & data):
RewritePlugin(data) {}
virtual void run() override; virtual void run() override;

View File

@ -29,7 +29,8 @@ class OverrideParam:
public RecursiveASTVisitor<OverrideParam>, public loplugin::Plugin public RecursiveASTVisitor<OverrideParam>, public loplugin::Plugin
{ {
public: public:
explicit OverrideParam(InstantiationData const & data): Plugin(data) {} explicit OverrideParam(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override; virtual void run() override;

View File

@ -31,7 +31,7 @@ class PassParamsByRef:
public RecursiveASTVisitor<PassParamsByRef>, public loplugin::Plugin public RecursiveASTVisitor<PassParamsByRef>, public loplugin::Plugin
{ {
public: public:
explicit PassParamsByRef(InstantiationData const & data): Plugin(data), mbInsideFunctionDecl(false) {} explicit PassParamsByRef(loplugin::InstantiationData const & data): Plugin(data), mbInsideFunctionDecl(false) {}
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -31,7 +31,7 @@ class PassStuffByRef:
public RecursiveASTVisitor<PassStuffByRef>, public loplugin::Plugin public RecursiveASTVisitor<PassStuffByRef>, public loplugin::Plugin
{ {
public: public:
explicit PassStuffByRef(InstantiationData const & data): Plugin(data), mbInsideFunctionDecl(false), mbFoundReturnValueDisqualifier(false) {} explicit PassStuffByRef(loplugin::InstantiationData const & data): Plugin(data), mbInsideFunctionDecl(false), mbFoundReturnValueDisqualifier(false) {}
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -226,9 +226,6 @@ bool isSamePathname(StringRef pathname, StringRef other);
} // namespace } // namespace
using loplugin::InstantiationData; //TODO
using loplugin::normalizeDotDotInFilePath; //TODO
#endif // COMPILEPLUGIN_H #endif // COMPILEPLUGIN_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -15,7 +15,8 @@ class PrivateBase:
public RecursiveASTVisitor<PrivateBase>, public loplugin::Plugin public RecursiveASTVisitor<PrivateBase>, public loplugin::Plugin
{ {
public: public:
explicit PrivateBase(InstantiationData const & data): Plugin(data) {} explicit PrivateBase(loplugin::InstantiationData const & data): Plugin(data)
{}
void run() override; void run() override;

View File

@ -26,7 +26,8 @@ class PtrVector:
public RecursiveASTVisitor<PtrVector>, public loplugin::Plugin public RecursiveASTVisitor<PtrVector>, public loplugin::Plugin
{ {
public: public:
explicit PtrVector(InstantiationData const & data): Plugin(data) {} explicit PtrVector(loplugin::InstantiationData const & data): Plugin(data)
{}
virtual void run() override virtual void run() override
{ {

View File

@ -25,7 +25,8 @@ class RangedForCopy:
public RecursiveASTVisitor<RangedForCopy>, public loplugin::Plugin public RecursiveASTVisitor<RangedForCopy>, public loplugin::Plugin
{ {
public: public:
explicit RangedForCopy(InstantiationData const & data): Plugin(data) {} explicit RangedForCopy(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override { virtual void run() override {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());

View File

@ -93,7 +93,8 @@ class RedundantCast:
public RecursiveASTVisitor<RedundantCast>, public loplugin::RewritePlugin public RecursiveASTVisitor<RedundantCast>, public loplugin::RewritePlugin
{ {
public: public:
explicit RedundantCast(InstantiationData const & data): RewritePlugin(data) explicit RedundantCast(loplugin::InstantiationData const & data):
RewritePlugin(data)
{} {}
virtual void run() override { virtual void run() override {

View File

@ -17,7 +17,8 @@ class RedundantCopy final:
public RecursiveASTVisitor<RedundantCopy>, public loplugin::Plugin public RecursiveASTVisitor<RedundantCopy>, public loplugin::Plugin
{ {
public: public:
explicit RedundantCopy(InstantiationData const & data): Plugin(data) {} explicit RedundantCopy(loplugin::InstantiationData const & data):
Plugin(data) {}
bool VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr const * expr) { bool VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr const * expr) {
if (ignoreLocation(expr)) { if (ignoreLocation(expr)) {

View File

@ -17,7 +17,7 @@ class RedundantInline:
public RecursiveASTVisitor<RedundantInline>, public loplugin::RewritePlugin public RecursiveASTVisitor<RedundantInline>, public loplugin::RewritePlugin
{ {
public: public:
explicit RedundantInline(InstantiationData const & data): explicit RedundantInline(loplugin::InstantiationData const & data):
RewritePlugin(data) {} RewritePlugin(data) {}
void run() override { void run() override {

View File

@ -39,7 +39,7 @@ class RedundantPointerOps:
public RecursiveASTVisitor<RedundantPointerOps>, public loplugin::Plugin public RecursiveASTVisitor<RedundantPointerOps>, public loplugin::Plugin
{ {
public: public:
explicit RedundantPointerOps(InstantiationData const & data): Plugin(data) {} explicit RedundantPointerOps(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -44,7 +44,8 @@ class RefCounting:
public RecursiveASTVisitor<RefCounting>, public loplugin::Plugin public RecursiveASTVisitor<RefCounting>, public loplugin::Plugin
{ {
public: public:
explicit RefCounting(InstantiationData const & data): Plugin(data) {} explicit RefCounting(loplugin::InstantiationData const & data): Plugin(data)
{}
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -23,7 +23,8 @@ class RenderContext:
public RecursiveASTVisitor<RenderContext>, public loplugin::Plugin public RecursiveASTVisitor<RenderContext>, public loplugin::Plugin
{ {
public: public:
explicit RenderContext(InstantiationData const & data): Plugin(data) {} explicit RenderContext(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override { virtual void run() override {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());

View File

@ -36,7 +36,8 @@ class ReservedId:
public RecursiveASTVisitor<ReservedId>, public loplugin::Plugin public RecursiveASTVisitor<ReservedId>, public loplugin::Plugin
{ {
public: public:
explicit ReservedId(InstantiationData const & data): Plugin(data) {} explicit ReservedId(loplugin::InstantiationData const & data): Plugin(data)
{}
void run() override; void run() override;

View File

@ -146,7 +146,8 @@ class SalBool:
public RecursiveASTVisitor<SalBool>, public loplugin::RewritePlugin public RecursiveASTVisitor<SalBool>, public loplugin::RewritePlugin
{ {
public: public:
explicit SalBool(InstantiationData const & data): RewritePlugin(data) {} explicit SalBool(loplugin::InstantiationData const & data):
RewritePlugin(data) {}
virtual void run() override; virtual void run() override;

View File

@ -23,7 +23,8 @@ class SalUnicodeLiteral final:
public RecursiveASTVisitor<SalUnicodeLiteral>, public loplugin::Plugin public RecursiveASTVisitor<SalUnicodeLiteral>, public loplugin::Plugin
{ {
public: public:
explicit SalUnicodeLiteral(InstantiationData const & data): Plugin(data) {} explicit SalUnicodeLiteral(loplugin::InstantiationData const & data):
Plugin(data) {}
bool VisitCXXStaticCastExpr(CXXStaticCastExpr const * expr) { bool VisitCXXStaticCastExpr(CXXStaticCastExpr const * expr) {
check(expr); check(expr);

View File

@ -26,7 +26,8 @@ class SfxPoolItem:
public RecursiveASTVisitor<SfxPoolItem>, public loplugin::Plugin public RecursiveASTVisitor<SfxPoolItem>, public loplugin::Plugin
{ {
public: public:
explicit SfxPoolItem(InstantiationData const & data): Plugin(data) {} explicit SfxPoolItem(loplugin::InstantiationData const & data): Plugin(data)
{}
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -54,7 +54,8 @@ class SimplifyBool:
public RecursiveASTVisitor<SimplifyBool>, public loplugin::Plugin public RecursiveASTVisitor<SimplifyBool>, public loplugin::Plugin
{ {
public: public:
explicit SimplifyBool(InstantiationData const & data): Plugin(data) {} explicit SimplifyBool(loplugin::InstantiationData const & data):
Plugin(data) {}
void run() override; void run() override;

View File

@ -71,7 +71,8 @@ class SingleValFields:
public RecursiveASTVisitor<SingleValFields>, public loplugin::Plugin public RecursiveASTVisitor<SingleValFields>, public loplugin::Plugin
{ {
public: public:
explicit SingleValFields(InstantiationData const & data): Plugin(data) {} explicit SingleValFields(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {
@ -116,7 +117,7 @@ void SingleValFields::niceName(const FieldDecl* fieldDecl, MyFieldInfo& aInfo)
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( fieldDecl->getLocation() ); SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( fieldDecl->getLocation() );
StringRef name = compiler.getSourceManager().getFilename(expansionLoc); StringRef name = compiler.getSourceManager().getFilename(expansionLoc);
aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
normalizeDotDotInFilePath(aInfo.sourceLocation); loplugin::normalizeDotDotInFilePath(aInfo.sourceLocation);
} }
bool SingleValFields::VisitFieldDecl( const FieldDecl* fieldDecl ) bool SingleValFields::VisitFieldDecl( const FieldDecl* fieldDecl )

View File

@ -46,7 +46,8 @@ class StaticAccess:
public RecursiveASTVisitor<StaticAccess>, public loplugin::Plugin public RecursiveASTVisitor<StaticAccess>, public loplugin::Plugin
{ {
public: public:
explicit StaticAccess(InstantiationData const & data): Plugin(data) {} explicit StaticAccess(loplugin::InstantiationData const & data):
Plugin(data) {}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -24,7 +24,7 @@ class StaticMethods:
private: private:
bool bVisitedThis; bool bVisitedThis;
public: public:
explicit StaticMethods(InstantiationData const & data): Plugin(data), bVisitedThis(false) {} explicit StaticMethods(loplugin::InstantiationData const & data): Plugin(data), bVisitedThis(false) {}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -45,7 +45,8 @@ class StringConcat:
public RecursiveASTVisitor<StringConcat>, public loplugin::Plugin public RecursiveASTVisitor<StringConcat>, public loplugin::Plugin
{ {
public: public:
explicit StringConcat(InstantiationData const & data): Plugin(data) {} explicit StringConcat(loplugin::InstantiationData const & data):
Plugin(data) {}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -105,8 +105,8 @@ class StringConstant:
public RecursiveASTVisitor<StringConstant>, public loplugin::RewritePlugin public RecursiveASTVisitor<StringConstant>, public loplugin::RewritePlugin
{ {
public: public:
explicit StringConstant(InstantiationData const & data): RewritePlugin(data) explicit StringConstant(loplugin::InstantiationData const & data):
{} RewritePlugin(data) {}
void run() override; void run() override;

View File

@ -27,7 +27,8 @@ class StringStatic
{ {
public: public:
explicit StringStatic(InstantiationData const& rData) : Plugin(rData) {} explicit StringStatic(loplugin::InstantiationData const& rData):
Plugin(rData) {}
void run() override; void run() override;
bool VisitVarDecl(VarDecl const*); bool VisitVarDecl(VarDecl const*);

View File

@ -21,7 +21,8 @@ class SubtleZeroInit final:
public RecursiveASTVisitor<SubtleZeroInit>, public loplugin::Plugin public RecursiveASTVisitor<SubtleZeroInit>, public loplugin::Plugin
{ {
public: public:
explicit SubtleZeroInit(InstantiationData const & data): Plugin(data) {} explicit SubtleZeroInit(loplugin::InstantiationData const & data):
Plugin(data) {}
bool VisitCXXNewExpr(CXXNewExpr const * expr) { bool VisitCXXNewExpr(CXXNewExpr const * expr) {
if (ignoreLocation(expr)) { if (ignoreLocation(expr)) {

View File

@ -21,7 +21,8 @@ class UnicodeToChar final:
public RecursiveASTVisitor<UnicodeToChar>, public loplugin::Plugin public RecursiveASTVisitor<UnicodeToChar>, public loplugin::Plugin
{ {
public: public:
explicit UnicodeToChar(InstantiationData const & data): Plugin(data) {} explicit UnicodeToChar(loplugin::InstantiationData const & data):
Plugin(data) {}
bool TraverseCStyleCastExpr(CStyleCastExpr * expr) { bool TraverseCStyleCastExpr(CStyleCastExpr * expr) {
subExprs_.push(expr->getSubExpr()); subExprs_.push(expr->getSubExpr());

View File

@ -32,7 +32,7 @@ class UnnecessaryCatchThrow:
public RecursiveASTVisitor<UnnecessaryCatchThrow>, public loplugin::Plugin public RecursiveASTVisitor<UnnecessaryCatchThrow>, public loplugin::Plugin
{ {
public: public:
explicit UnnecessaryCatchThrow(InstantiationData const & data): Plugin(data) {} explicit UnnecessaryCatchThrow(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -27,7 +27,7 @@ class UnnecessaryOverride:
public RecursiveASTVisitor<UnnecessaryOverride>, public loplugin::Plugin public RecursiveASTVisitor<UnnecessaryOverride>, public loplugin::Plugin
{ {
public: public:
explicit UnnecessaryOverride(InstantiationData const & data): Plugin(data) {} explicit UnnecessaryOverride(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -47,7 +47,8 @@ class UnnecessaryParen:
public RecursiveASTVisitor<UnnecessaryParen>, public loplugin::Plugin public RecursiveASTVisitor<UnnecessaryParen>, public loplugin::Plugin
{ {
public: public:
explicit UnnecessaryParen(InstantiationData const & data): Plugin(data) {} explicit UnnecessaryParen(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -53,7 +53,8 @@ class UnnecessaryVirtual:
public RecursiveASTVisitor<UnnecessaryVirtual>, public loplugin::Plugin public RecursiveASTVisitor<UnnecessaryVirtual>, public loplugin::Plugin
{ {
public: public:
explicit UnnecessaryVirtual(InstantiationData const & data): Plugin(data) {} explicit UnnecessaryVirtual(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {
@ -158,7 +159,7 @@ std::string UnnecessaryVirtual::toString(SourceLocation loc)
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc ); SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc );
StringRef name = compiler.getSourceManager().getFilename(expansionLoc); StringRef name = compiler.getSourceManager().getFilename(expansionLoc);
std::string sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); std::string sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
normalizeDotDotInFilePath(sourceLocation); loplugin::normalizeDotDotInFilePath(sourceLocation);
return sourceLocation; return sourceLocation;
} }

View File

@ -15,7 +15,7 @@ class UnoAny:
public RecursiveASTVisitor<UnoAny>, public loplugin::Plugin public RecursiveASTVisitor<UnoAny>, public loplugin::Plugin
{ {
public: public:
explicit UnoAny(InstantiationData const & data): Plugin(data) {} explicit UnoAny(loplugin::InstantiationData const & data): Plugin(data) {}
void run() override { void run() override {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());

View File

@ -53,7 +53,7 @@ Decl const * getPreviousNonFriendDecl(Decl const * decl) {
class UnrefFun: public RecursiveASTVisitor<UnrefFun>, public loplugin::Plugin { class UnrefFun: public RecursiveASTVisitor<UnrefFun>, public loplugin::Plugin {
public: public:
explicit UnrefFun(InstantiationData const & data): Plugin(data) {} explicit UnrefFun(loplugin::InstantiationData const & data): Plugin(data) {}
void run() override void run() override
{ TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -62,7 +62,7 @@ class UnusedEnumConstants:
public RecursiveASTVisitor<UnusedEnumConstants>, public loplugin::Plugin public RecursiveASTVisitor<UnusedEnumConstants>, public loplugin::Plugin
{ {
public: public:
explicit UnusedEnumConstants(InstantiationData const & data): Plugin(data) {} explicit UnusedEnumConstants(loplugin::InstantiationData const & data): Plugin(data) {}
virtual void run() override virtual void run() override
{ {
@ -107,7 +107,7 @@ MyFieldInfo UnusedEnumConstants::niceName(const EnumConstantDecl* enumConstantDe
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( enumConstantDecl->getLocation() ); SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( enumConstantDecl->getLocation() );
StringRef name = compiler.getSourceManager().getFilename(expansionLoc); StringRef name = compiler.getSourceManager().getFilename(expansionLoc);
aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
normalizeDotDotInFilePath(aInfo.sourceLocation); loplugin::normalizeDotDotInFilePath(aInfo.sourceLocation);
return aInfo; return aInfo;
} }

View File

@ -132,7 +132,8 @@ class UnusedFields:
public RecursiveASTVisitor<UnusedFields>, public loplugin::Plugin public RecursiveASTVisitor<UnusedFields>, public loplugin::Plugin
{ {
public: public:
explicit UnusedFields(InstantiationData const & data): Plugin(data) {} explicit UnusedFields(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override; virtual void run() override;
@ -237,7 +238,7 @@ MyFieldInfo UnusedFields::niceName(const FieldDecl* fieldDecl)
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( fieldDecl->getLocation() ); SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( fieldDecl->getLocation() );
StringRef name = compiler.getSourceManager().getFilename(expansionLoc); StringRef name = compiler.getSourceManager().getFilename(expansionLoc);
aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); aInfo.sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
normalizeDotDotInFilePath(aInfo.sourceLocation); loplugin::normalizeDotDotInFilePath(aInfo.sourceLocation);
switch (fieldDecl->getAccess()) switch (fieldDecl->getAccess())
{ {

View File

@ -31,7 +31,7 @@ class UnusedFieldsRemove:
public RecursiveASTVisitor<UnusedFieldsRemove>, public loplugin::RewritePlugin public RecursiveASTVisitor<UnusedFieldsRemove>, public loplugin::RewritePlugin
{ {
public: public:
explicit UnusedFieldsRemove(InstantiationData const & data); explicit UnusedFieldsRemove(loplugin::InstantiationData const & data);
~UnusedFieldsRemove(); ~UnusedFieldsRemove();
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
@ -52,7 +52,7 @@ size_t getFilesize(const char* filename)
return st.st_size; return st.st_size;
} }
UnusedFieldsRemove::UnusedFieldsRemove(InstantiationData const & data): RewritePlugin(data) UnusedFieldsRemove::UnusedFieldsRemove(loplugin::InstantiationData const & data): RewritePlugin(data)
{ {
static const char sInputFile[] = SRCDIR "/result.txt"; static const char sInputFile[] = SRCDIR "/result.txt";
mmapFilesize = getFilesize(sInputFile); mmapFilesize = getFilesize(sInputFile);

View File

@ -78,7 +78,8 @@ class UnusedMethods:
public RecursiveASTVisitor<UnusedMethods>, public loplugin::Plugin public RecursiveASTVisitor<UnusedMethods>, public loplugin::Plugin
{ {
public: public:
explicit UnusedMethods(InstantiationData const & data): Plugin(data) {} explicit UnusedMethods(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {
@ -177,7 +178,7 @@ std::string UnusedMethods::toString(SourceLocation loc)
SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc ); SourceLocation expansionLoc = compiler.getSourceManager().getExpansionLoc( loc );
StringRef name = compiler.getSourceManager().getFilename(expansionLoc); StringRef name = compiler.getSourceManager().getFilename(expansionLoc);
std::string sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc)); std::string sourceLocation = std::string(name.substr(strlen(SRCDIR)+1)) + ":" + std::to_string(compiler.getSourceManager().getSpellingLineNumber(expansionLoc));
normalizeDotDotInFilePath(sourceLocation); loplugin::normalizeDotDotInFilePath(sourceLocation);
return sourceLocation; return sourceLocation;
} }

View File

@ -32,7 +32,7 @@ class UnusedMethodsRemove:
public RecursiveASTVisitor<UnusedMethodsRemove>, public loplugin::RewritePlugin public RecursiveASTVisitor<UnusedMethodsRemove>, public loplugin::RewritePlugin
{ {
public: public:
explicit UnusedMethodsRemove(InstantiationData const & data); explicit UnusedMethodsRemove(loplugin::InstantiationData const & data);
~UnusedMethodsRemove(); ~UnusedMethodsRemove();
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
@ -53,7 +53,7 @@ size_t getFilesize(const char* filename)
return st.st_size; return st.st_size;
} }
UnusedMethodsRemove::UnusedMethodsRemove(InstantiationData const & data): RewritePlugin(data) UnusedMethodsRemove::UnusedMethodsRemove(loplugin::InstantiationData const & data): RewritePlugin(data)
{ {
static const char sInputFile[] = SRCDIR "/result.txt"; static const char sInputFile[] = SRCDIR "/result.txt";
mmapFilesize = getFilesize(sInputFile); mmapFilesize = getFilesize(sInputFile);

View File

@ -27,7 +27,8 @@ class UseUniquePtr:
public RecursiveASTVisitor<UseUniquePtr>, public loplugin::Plugin public RecursiveASTVisitor<UseUniquePtr>, public loplugin::Plugin
{ {
public: public:
explicit UseUniquePtr(InstantiationData const & data): Plugin(data) {} explicit UseUniquePtr(loplugin::InstantiationData const & data):
Plugin(data) {}
virtual void run() override virtual void run() override
{ {

View File

@ -30,7 +30,8 @@ class VCLWidgets:
public RecursiveASTVisitor<VCLWidgets>, public loplugin::Plugin public RecursiveASTVisitor<VCLWidgets>, public loplugin::Plugin
{ {
public: public:
explicit VCLWidgets(InstantiationData const & data): Plugin(data) {} explicit VCLWidgets(loplugin::InstantiationData const & data): Plugin(data)
{}
virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }

View File

@ -24,7 +24,8 @@ class WeakObject
{ {
public: public:
explicit WeakObject(InstantiationData const& rData) : Plugin(rData) {} explicit WeakObject(loplugin::InstantiationData const& rData): Plugin(rData)
{}
void run() override { void run() override {
if (compiler.getLangOpts().CPlusPlus) { // no OWeakObject in C if (compiler.getLangOpts().CPlusPlus) { // no OWeakObject in C