diff options
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/plugin.cxx | 3 | ||||
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 25 |
2 files changed, 4 insertions, 24 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx index e56664bd0f6b..38308128d6aa 100644 --- a/compilerplugins/clang/plugin.cxx +++ b/compilerplugins/clang/plugin.cxx @@ -56,8 +56,7 @@ bool Plugin::ignoreLocation( SourceLocation loc ) const char* bufferName = compiler.getSourceManager().getPresumedLoc( expansionLoc ).getFilename(); if( bufferName == NULL ) return true; - if( strncmp( bufferName, OUTDIR, strlen( OUTDIR )) == 0 - || strncmp( bufferName, WORKDIR, strlen( WORKDIR )) == 0 + if( strncmp( bufferName, WORKDIR, strlen( WORKDIR )) == 0 || strncmp( bufferName, BUILDDIR, strlen( BUILDDIR )) == 0 || strncmp( bufferName, SRCDIR, strlen( SRCDIR )) == 0 ) return false; // ok diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index 378e06d6d9d3..a49398a53a82 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -162,30 +162,12 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) continue; // Failed modification because of a macro expansion? /* Check where the file actually is, and warn about cases where modification most probably doesn't matter (generated files in workdir). - The order here is important, as OUTDIR and WORKDIR are often in SRCDIR/BUILDDIR, + The order here is important, as INSTDIR and WORKDIR are often in SRCDIR/BUILDDIR, and BUILDDIR is sometimes in SRCDIR. */ string modifyFile; const char* pathWarning = NULL; bool skip = false; - if( strncmp( e->getName(), OUTDIR "/", strlen( OUTDIR "/" )) == 0 ) - { - /* Try to find a matching file for a file in solver/ (include files - are usually included from there rather than from the source dir) if possible. */ - if( strncmp( e->getName(), OUTDIR "/inc/", strlen( OUTDIR ) + strlen( "/inc/" )) == 0 ) - { - string filename( e->getName()); - int modulePos = strlen( OUTDIR ) + strlen( "/inc/" ); - size_t moduleEnd = filename.find( '/', modulePos ); - if( moduleEnd != string::npos ) - { - modifyFile = SRCDIR "/" + filename.substr( modulePos, moduleEnd - modulePos ) - + "/inc/" + filename.substr( modulePos ); - } - } - if( modifyFile.empty()) - pathWarning = "modified source in solver/ : %0"; - } - else if( strncmp( e->getName(), WORKDIR "/", strlen( WORKDIR "/" )) == 0 ) + if( strncmp( e->getName(), WORKDIR "/", strlen( WORKDIR "/" )) == 0 ) pathWarning = "modified source in workdir/ : %0"; else if( strcmp( SRCDIR, BUILDDIR ) != 0 && strncmp( e->getName(), BUILDDIR "/", strlen( BUILDDIR "/" )) == 0 ) pathWarning = "modified source in build dir : %0"; @@ -198,8 +180,7 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) } if( modifyFile.empty()) modifyFile = e->getName(); - // Check whether the modified file is in the wanted scope (done after path checking above), so - // that files mapped from OUTDIR to SRCDIR are included. + // Check whether the modified file is in the wanted scope if( scope == "mainfile" ) { if( it->first != context.getSourceManager().getMainFileID()) |