Kaydet (Commit) 3df0d6e3 authored tarafından Luboš Luňák's avatar Luboš Luňák

warn if sharedvisitor generator cannot find code in a source file

Just in case there's a typo or something, without this that source
would not be compiled but shared visitor would not include that
functionality either.

Change-Id: I5d9fad129b83f24fed2613bc071cb33e149c1db3
Reviewed-on: https://gerrit.libreoffice.org/69093
Tested-by: Jenkins
Reviewed-by: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 6d9b2713
......@@ -393,6 +393,8 @@ static TraverseFunctionInfo findOrCreateTraverseFunctionInfo( PluginInfo& plugin
return info;
}
static bool foundSomething;
bool CheckFileVisitor::VisitCXXRecordDecl( CXXRecordDecl* decl )
{
if( !isDerivedFrom( decl, inheritsPluginClassCheck ))
......@@ -477,6 +479,8 @@ bool CheckFileVisitor::VisitCXXRecordDecl( CXXRecordDecl* decl )
plugins[ PluginVisitImplicit ].push_back( move( pluginInfo ));
else
plugins[ PluginBasic ].push_back( move( pluginInfo ));
foundSomething = true;
return true;
}
......@@ -547,11 +551,18 @@ int main(int argc, char** argv)
"-D__STDC_FORMAT_MACROS",
"-D__STDC_LIMIT_MACROS",
};
foundSomething = false;
if( !clang::tooling::runToolOnCodeWithArgs( new FindNamedClassAction, contents, args, argv[ i ] ))
{
cerr << "Failed to analyze: " << argv[ i ] << endl;
return 2;
}
if( !foundSomething )
{
// there's #ifndef LO_CLANG_SHARED_PLUGINS in the source, but no class matched
cerr << "Failed to find code: " << argv[ i ] << endl;
return 2;
}
}
for( int type = Plugin_Begin; type < Plugin_End; ++type )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment