2019-03-07 07:31:17 -06:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2019-09-03 08:24:29 -05:00
|
|
|
#include <algorithm>
|
|
|
|
#include <cassert>
|
2019-03-21 13:33:34 -05:00
|
|
|
#include <cstddef>
|
|
|
|
#include <cstring>
|
2019-03-07 07:31:17 -06:00
|
|
|
#include <iostream>
|
|
|
|
#include <fstream>
|
2019-08-30 07:09:22 -05:00
|
|
|
#include <memory>
|
2019-03-07 07:31:17 -06:00
|
|
|
#include <set>
|
2019-09-03 08:24:29 -05:00
|
|
|
#include <vector>
|
2019-03-07 07:31:17 -06:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
// Info about a Visit* function in a plugin.
|
|
|
|
struct VisitFunctionInfo
|
|
|
|
{
|
|
|
|
string name;
|
|
|
|
string argument;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Info about a Traverse* function in a plugin.
|
|
|
|
struct TraverseFunctionInfo
|
|
|
|
{
|
|
|
|
string name;
|
|
|
|
string argument;
|
|
|
|
bool hasPre = false;
|
|
|
|
bool hasPost = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VisitFunctionInfoLess
|
|
|
|
{
|
|
|
|
bool operator()( const VisitFunctionInfo& l, const VisitFunctionInfo& r ) const
|
|
|
|
{
|
|
|
|
return l.name < r.name;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TraverseFunctionInfoLess
|
|
|
|
{
|
|
|
|
bool operator()( const TraverseFunctionInfo& l, const TraverseFunctionInfo& r ) const
|
|
|
|
{
|
|
|
|
return l.name < r.name;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Information about each LO plugin.
|
|
|
|
struct PluginInfo
|
|
|
|
{
|
|
|
|
string className; // e.g. "BadStatics"
|
|
|
|
string variableName; // e.g. "badStatics"
|
|
|
|
string lowercaseName;
|
|
|
|
bool shouldVisitTemplateInstantiations;
|
|
|
|
bool shouldVisitImplicitCode;
|
|
|
|
set< VisitFunctionInfo, VisitFunctionInfoLess > visitFunctions;
|
|
|
|
set< TraverseFunctionInfo, TraverseFunctionInfoLess > traverseFunctions;
|
|
|
|
};
|
|
|
|
|
|
|
|
// We need separate visitors for shouldVisitTemplateInstantiations and shouldVisitImplicitCode,
|
|
|
|
// so split plugins into groups by what they should visit.
|
|
|
|
// It seems that trying to handle the shouldVisit* functionality with just one visitor
|
|
|
|
// is tricky.
|
|
|
|
enum PluginType
|
|
|
|
{
|
|
|
|
PluginBasic,
|
|
|
|
PluginVisitTemplates,
|
|
|
|
PluginVisitImplicit,
|
|
|
|
PluginVisitTemplatesImplicit,
|
|
|
|
};
|
|
|
|
|
|
|
|
const int Plugin_Begin = PluginBasic;
|
|
|
|
const int Plugin_End = PluginVisitTemplatesImplicit + 1;
|
|
|
|
static const char* const pluginTypeNames[ Plugin_End ]
|
|
|
|
= { "Basic", "VisitTemplates", "VisitImplicit", "VisitTemplatesImplicit" };
|
|
|
|
|
|
|
|
static vector< PluginInfo > plugins[ Plugin_End ];
|
|
|
|
|
|
|
|
|
|
|
|
void generateVisitor( PluginType type );
|
|
|
|
|
|
|
|
void generate()
|
|
|
|
{
|
|
|
|
ostream& output = cout;
|
|
|
|
output <<
|
|
|
|
"// This file is autogenerated. Do not modify.\n"
|
|
|
|
"// Generated by compilerplugins/clang/sharedvisitor/generator.cxx .\n"
|
|
|
|
"\n"
|
|
|
|
"#ifdef LO_CLANG_SHARED_PLUGINS\n"
|
|
|
|
"\n"
|
|
|
|
"#include <config_clang.h>\n"
|
|
|
|
"\n"
|
|
|
|
"#include <clang/AST/ASTContext.h>\n"
|
|
|
|
"#include <clang/AST/RecursiveASTVisitor.h>\n"
|
|
|
|
"\n"
|
2019-09-03 08:24:29 -05:00
|
|
|
"#include \"plugin.hxx\"\n"
|
2019-03-07 07:31:17 -06:00
|
|
|
"\n";
|
|
|
|
|
|
|
|
output << "#undef LO_CLANG_SHARED_PLUGINS // to get sources of individual plugins\n";
|
|
|
|
for( const auto& pluginGroup : plugins )
|
|
|
|
for( const PluginInfo& plugin : pluginGroup )
|
2019-09-03 08:24:29 -05:00
|
|
|
output << "#include \"" << plugin.lowercaseName << ".cxx\"" << endl;
|
2019-03-07 07:31:17 -06:00
|
|
|
|
|
|
|
output <<
|
|
|
|
"\n"
|
|
|
|
"using namespace clang;\n"
|
|
|
|
"using namespace llvm;\n"
|
|
|
|
"\n"
|
|
|
|
"namespace loplugin\n"
|
|
|
|
"{\n";
|
|
|
|
|
|
|
|
for( int type = Plugin_Begin; type < Plugin_End; ++type )
|
|
|
|
generateVisitor( static_cast< PluginType >( type ));
|
|
|
|
|
|
|
|
output <<
|
|
|
|
"} // namespace loplugin\n"
|
|
|
|
"\n"
|
|
|
|
"#endif // LO_CLANG_SHARED_PLUGINS\n";
|
2019-10-06 08:01:07 -05:00
|
|
|
}
|
2019-03-07 07:31:17 -06:00
|
|
|
|
|
|
|
void generateVisitor( PluginType type )
|
|
|
|
{
|
|
|
|
if( plugins[ type ].empty())
|
|
|
|
return;
|
|
|
|
ostream& output = cout;
|
|
|
|
output <<
|
|
|
|
"\n"
|
|
|
|
"class SharedRecursiveASTVisitor" << pluginTypeNames[ type ] << "\n"
|
|
|
|
" : public FilteringPlugin< SharedRecursiveASTVisitor" << pluginTypeNames[ type ] << ">\n"
|
|
|
|
"{\n"
|
|
|
|
"public:\n"
|
|
|
|
" explicit SharedRecursiveASTVisitor" << pluginTypeNames[ type ] << "(const InstantiationData& rData)\n"
|
|
|
|
" : FilteringPlugin(rData)\n";
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
output << " , " << plugin.variableName << "( nullptr )\n";
|
|
|
|
output << " {}\n";
|
|
|
|
|
|
|
|
output <<
|
|
|
|
" virtual bool preRun() override\n"
|
|
|
|
" {\n";
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
{
|
|
|
|
output << " if( " << plugin.variableName << " && !" << plugin.variableName << "->preRun())\n";
|
|
|
|
// This will disable the plugin for the rest of the run.
|
|
|
|
output << " " << plugin.variableName << " = nullptr;\n";
|
|
|
|
}
|
|
|
|
output <<
|
|
|
|
" return anyPluginActive();\n"
|
|
|
|
" }\n";
|
|
|
|
|
|
|
|
output <<
|
|
|
|
" virtual void postRun() override\n"
|
|
|
|
" {\n";
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
{
|
|
|
|
output << " if( " << plugin.variableName << " )\n";
|
|
|
|
output << " " << plugin.variableName << "->postRun();\n";
|
|
|
|
}
|
|
|
|
output <<
|
|
|
|
" }\n";
|
|
|
|
|
|
|
|
output <<
|
|
|
|
" virtual void run() override {\n"
|
|
|
|
" if (preRun()) {\n"
|
|
|
|
" TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());\n"
|
|
|
|
" postRun();\n"
|
|
|
|
" }\n"
|
|
|
|
" }\n"
|
|
|
|
" enum { isSharedPlugin = true };\n";
|
|
|
|
|
|
|
|
output <<
|
|
|
|
" virtual bool setSharedPlugin( Plugin* plugin, const char* name ) override\n"
|
|
|
|
" {\n";
|
|
|
|
bool first = true;
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
{
|
|
|
|
output << " ";
|
|
|
|
if( !first )
|
|
|
|
output << "else ";
|
|
|
|
first = false;
|
|
|
|
output << "if( strcmp( name, \"" << plugin.lowercaseName << "\" ) == 0 )\n";
|
|
|
|
output << " " << plugin.variableName << " = static_cast< " << plugin.className << "* >( plugin );\n";
|
|
|
|
}
|
|
|
|
output <<
|
|
|
|
" else\n"
|
|
|
|
" return false;\n"
|
|
|
|
" return true;\n"
|
|
|
|
" }\n";
|
|
|
|
|
|
|
|
if( type == PluginVisitTemplates || type == PluginVisitTemplatesImplicit )
|
|
|
|
output << "bool shouldVisitTemplateInstantiations() const { return true; }\n";
|
|
|
|
if( type == PluginVisitImplicit || type == PluginVisitTemplatesImplicit )
|
|
|
|
output << "bool shouldVisitImplicitCode() const { return true; }\n";
|
|
|
|
|
|
|
|
set< VisitFunctionInfo, VisitFunctionInfoLess > visitFunctions;
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
for( const VisitFunctionInfo& visit : plugin.visitFunctions )
|
|
|
|
visitFunctions.insert( visit );
|
|
|
|
for( const VisitFunctionInfo& visit : visitFunctions )
|
|
|
|
{
|
|
|
|
output << " bool " << visit.name << "(" << visit.argument << " arg)\n";
|
|
|
|
output <<
|
|
|
|
" {\n"
|
|
|
|
" if( ignoreLocation( arg ))\n"
|
|
|
|
" return true;\n";
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
{
|
|
|
|
if( plugin.visitFunctions.find( visit ) == plugin.visitFunctions.end())
|
|
|
|
continue;
|
|
|
|
output << " if( " << plugin.variableName << " != nullptr ";
|
|
|
|
output << ")\n";
|
|
|
|
output << " {\n";
|
|
|
|
output << " if( !" << plugin.variableName << "->" << visit.name << "( arg ))\n";
|
|
|
|
// This will disable the plugin for the rest of the run (as would returning false
|
|
|
|
// from Visit* normally do in the non-shared case).
|
|
|
|
output << " " << plugin.variableName << " = nullptr;\n";
|
|
|
|
output << " }\n";
|
|
|
|
}
|
|
|
|
output <<
|
|
|
|
" return anyPluginActive();\n"
|
|
|
|
" }\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
set< TraverseFunctionInfo, TraverseFunctionInfoLess > traverseFunctions;
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
for( const TraverseFunctionInfo& traverse : plugin.traverseFunctions )
|
|
|
|
traverseFunctions.insert( traverse );
|
|
|
|
for( const TraverseFunctionInfo& traverse : traverseFunctions )
|
|
|
|
{
|
|
|
|
output << " bool " << traverse.name << "(" << traverse.argument << " arg)\n";
|
|
|
|
output << " {\n";
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
{
|
|
|
|
auto pluginTraverse = plugin.traverseFunctions.find( traverse );
|
|
|
|
if( pluginTraverse == plugin.traverseFunctions.end())
|
|
|
|
continue;
|
|
|
|
output << " " << plugin.className << "* save" << plugin.className << " = " << plugin.variableName << ";\n";
|
|
|
|
if( pluginTraverse->hasPre )
|
|
|
|
{
|
|
|
|
output << " if( " << plugin.variableName << " != nullptr ";
|
|
|
|
output << ")\n";
|
|
|
|
output << " {\n";
|
|
|
|
output << " if( !" << plugin.variableName << "->Pre" << traverse.name << "( arg ))\n";
|
|
|
|
// This will disable the plugin for the time of the traverse, until restored later,
|
|
|
|
// just like directly returning from Traverse* would skip that part.
|
|
|
|
output << " " << plugin.variableName << " = nullptr;\n";
|
|
|
|
output << " }\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
output << " bool ret = RecursiveASTVisitor::" << traverse.name << "( arg );\n";
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
{
|
|
|
|
auto pluginTraverse = plugin.traverseFunctions.find( traverse );
|
|
|
|
if( pluginTraverse == plugin.traverseFunctions.end())
|
|
|
|
continue;
|
|
|
|
if( pluginTraverse->hasPost )
|
|
|
|
{
|
|
|
|
output << " if( " << plugin.variableName << " != nullptr ";
|
|
|
|
output << ")\n";
|
|
|
|
output << " {\n";
|
2019-07-17 08:07:50 -05:00
|
|
|
output << " if( !" << plugin.variableName << "->Post" << traverse.name << "( arg, ret ))\n";
|
|
|
|
// This will disable the plugin for the rest of the run.
|
|
|
|
output << " save" << plugin.className << " = nullptr;\n";
|
2019-03-07 07:31:17 -06:00
|
|
|
output << " }\n";
|
|
|
|
}
|
|
|
|
output << " " << plugin.variableName << " = save" << plugin.className << ";\n";
|
|
|
|
}
|
|
|
|
output << " return ret;\n";
|
|
|
|
output << " }\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
output <<
|
|
|
|
"private:\n";
|
|
|
|
|
|
|
|
output <<
|
|
|
|
" bool anyPluginActive() const\n"
|
|
|
|
" {\n";
|
|
|
|
first = true;
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
{
|
|
|
|
if( first )
|
|
|
|
output << " return " << plugin.variableName << " != nullptr";
|
|
|
|
else
|
|
|
|
output << "\n || " << plugin.variableName << " != nullptr";
|
|
|
|
first = false;
|
|
|
|
}
|
|
|
|
output << ";\n";
|
|
|
|
output << " }\n";
|
|
|
|
|
|
|
|
for( const PluginInfo& plugin : plugins[ type ] )
|
|
|
|
output << " " << plugin.className << "* " << plugin.variableName << ";\n";
|
|
|
|
|
|
|
|
output <<
|
|
|
|
"};\n"
|
|
|
|
"\n"
|
|
|
|
"loplugin::Plugin::Registration< SharedRecursiveASTVisitor" << pluginTypeNames[ type ]
|
|
|
|
<< " > registration" << pluginTypeNames[ type ] << "(\"sharedvisitor" << pluginTypeNames[ type ] << "\");\n"
|
|
|
|
"\n";
|
|
|
|
}
|
|
|
|
|
2019-09-03 08:24:29 -05:00
|
|
|
static string getValue( const string& line, const char* tag )
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
size_t taglen = strlen( tag );
|
|
|
|
if( line.size() < taglen + 2 )
|
|
|
|
return string();
|
|
|
|
if( line.compare( 0, taglen, tag ) != 0 )
|
|
|
|
return string();
|
|
|
|
if( line[ taglen ] != ':' )
|
|
|
|
return string();
|
|
|
|
return line.substr( taglen + 1 );
|
2019-03-07 07:31:17 -06:00
|
|
|
}
|
|
|
|
|
2019-09-03 08:24:29 -05:00
|
|
|
static bool readFile( const string& fileName )
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
ifstream file( fileName );
|
|
|
|
if( !file )
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
cerr << "Cannot open file " << fileName << endl;
|
|
|
|
return false;
|
2019-03-07 07:31:17 -06:00
|
|
|
}
|
|
|
|
PluginInfo pluginInfo;
|
2019-09-03 08:24:29 -05:00
|
|
|
string line;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
getline( file, line );
|
|
|
|
} while( !line.empty() && line[ 0 ] == '#' );
|
|
|
|
string version = getValue( line, "InfoVersion" );
|
|
|
|
if( version != "1" )
|
|
|
|
{
|
|
|
|
cerr << "Incorrect version '" << version << "'" << endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
getline( file, line );
|
|
|
|
pluginInfo.className = getValue( line, "ClassName" );
|
2019-03-07 07:31:17 -06:00
|
|
|
pluginInfo.variableName = pluginInfo.className;
|
|
|
|
assert( pluginInfo.variableName.size() > 0 );
|
|
|
|
pluginInfo.variableName[ 0 ] = tolower( pluginInfo.variableName[ 0 ] );
|
|
|
|
pluginInfo.lowercaseName = pluginInfo.className;
|
|
|
|
for( char& c : pluginInfo.lowercaseName )
|
|
|
|
c = tolower( c );
|
|
|
|
pluginInfo.shouldVisitTemplateInstantiations = false;
|
|
|
|
pluginInfo.shouldVisitImplicitCode = false;
|
2019-09-03 08:24:29 -05:00
|
|
|
bool endOk = false;
|
|
|
|
for(;;)
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
string line;
|
|
|
|
getline( file, line );
|
|
|
|
if( file.eof() || !file )
|
|
|
|
{
|
|
|
|
cerr << "Unexpected end of file" << endl;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if( line.empty())
|
2019-03-07 07:31:17 -06:00
|
|
|
continue;
|
2019-09-03 08:24:29 -05:00
|
|
|
if( line == "InfoEnd" )
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
endOk = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if( line == "VisitFunctionStart" )
|
|
|
|
{
|
|
|
|
VisitFunctionInfo visitInfo;
|
|
|
|
getline( file, line );
|
|
|
|
visitInfo.name = getValue( line, "VisitFunctionName" );
|
|
|
|
getline( file, line );
|
|
|
|
visitInfo.argument = getValue( line, "VisitFunctionArgument" );
|
|
|
|
getline( file, line );
|
|
|
|
if( line != "VisitFunctionEnd" )
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
cerr << "Missing VisitFunctionEnd" << endl;
|
|
|
|
return false;
|
2019-03-07 07:31:17 -06:00
|
|
|
}
|
2019-09-03 08:24:29 -05:00
|
|
|
pluginInfo.visitFunctions.insert( move( visitInfo ));
|
2019-03-07 07:31:17 -06:00
|
|
|
}
|
2019-09-03 08:24:29 -05:00
|
|
|
else if( line == "TraverseFunctionStart" )
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
TraverseFunctionInfo traverseInfo;
|
|
|
|
getline( file, line );
|
|
|
|
traverseInfo.name = getValue( line, "TraverseFunctionName" );
|
|
|
|
getline( file, line );
|
|
|
|
traverseInfo.argument = getValue( line, "TraverseFunctionArgument" );
|
|
|
|
getline( file, line );
|
|
|
|
traverseInfo.hasPre = getValue( line, "TraverseFunctionHasPre" ) == "1";
|
|
|
|
getline( file, line );
|
|
|
|
traverseInfo.hasPost = getValue( line, "TraverseFunctionHasPost" ) == "1";
|
|
|
|
getline( file, line );
|
|
|
|
if( line != "TraverseFunctionEnd" )
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
cerr << "Missing TraverseFunctionEnd" << endl;
|
|
|
|
return false;
|
2019-03-07 07:31:17 -06:00
|
|
|
}
|
2019-09-03 08:24:29 -05:00
|
|
|
pluginInfo.traverseFunctions.insert( move( traverseInfo ));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
string value;
|
|
|
|
value = getValue( line, "ShouldVisitTemplateInstantiations" );
|
|
|
|
if( value == "1" )
|
|
|
|
pluginInfo.shouldVisitTemplateInstantiations = true;
|
2019-03-07 07:31:17 -06:00
|
|
|
else
|
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
value = getValue( line, "ShouldVisitImplicitCode" );
|
|
|
|
if( value == "1" )
|
|
|
|
pluginInfo.shouldVisitImplicitCode = true;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cerr << "Unknown line " << line << endl;
|
|
|
|
return false;
|
|
|
|
}
|
2019-03-07 07:31:17 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-03 08:24:29 -05:00
|
|
|
assert( endOk );
|
2019-10-06 07:22:59 -05:00
|
|
|
(void)endOk;
|
2019-09-03 08:24:29 -05:00
|
|
|
|
2019-03-07 07:31:17 -06:00
|
|
|
if( pluginInfo.shouldVisitTemplateInstantiations && pluginInfo.shouldVisitImplicitCode )
|
|
|
|
plugins[ PluginVisitTemplatesImplicit ].push_back( move( pluginInfo ));
|
|
|
|
else if( pluginInfo.shouldVisitTemplateInstantiations )
|
|
|
|
plugins[ PluginVisitTemplates ].push_back( move( pluginInfo ));
|
|
|
|
else if( pluginInfo.shouldVisitImplicitCode )
|
|
|
|
plugins[ PluginVisitImplicit ].push_back( move( pluginInfo ));
|
|
|
|
else
|
|
|
|
plugins[ PluginBasic ].push_back( move( pluginInfo ));
|
2019-03-12 06:35:53 -05:00
|
|
|
|
2019-03-07 07:31:17 -06:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
for( int i = 1 ; i < argc; ++i )
|
2019-03-07 07:31:17 -06:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
if( !readFile( argv[ i ] ))
|
2019-03-12 06:35:53 -05:00
|
|
|
{
|
2019-09-03 08:24:29 -05:00
|
|
|
cerr << "Error reading " << argv[ i ] << endl;
|
|
|
|
return 1;
|
2019-03-12 06:35:53 -05:00
|
|
|
}
|
2019-03-07 07:31:17 -06:00
|
|
|
}
|
|
|
|
for( int type = Plugin_Begin; type < Plugin_End; ++type )
|
|
|
|
{
|
|
|
|
sort( plugins[ static_cast< PluginType >( type ) ].begin(), plugins[ static_cast< PluginType >( type ) ].end(),
|
|
|
|
[]( const PluginInfo& l, const PluginInfo& r ) { return l.className < r.className; } );
|
|
|
|
}
|
|
|
|
generate();
|
|
|
|
return 0;
|
|
|
|
}
|