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

fix detection whether to ignore a source file or not

When compiling using icecream, the whole input is one file fed from stdin,
so getBufferName() is "<stdin>", so get the filename from #line directives.

Change-Id: Ie87937b10b0c7e8ddfa57a405b80fd9bde68dd0a
üst 3527efa7
...@@ -55,9 +55,8 @@ bool Plugin::ignoreLocation( SourceLocation loc ) ...@@ -55,9 +55,8 @@ bool Plugin::ignoreLocation( SourceLocation loc )
SourceLocation expansionLoc = context.getSourceManager().getExpansionLoc( loc ); SourceLocation expansionLoc = context.getSourceManager().getExpansionLoc( loc );
if( context.getSourceManager().isInSystemHeader( expansionLoc )) if( context.getSourceManager().isInSystemHeader( expansionLoc ))
return true; return true;
bool invalid; const char* bufferName = context.getSourceManager().getPresumedLoc( expansionLoc ).getFilename();
const char* bufferName = context.getSourceManager().getBufferName( expansionLoc, &invalid ); if( bufferName == NULL )
if( invalid )
return true; return true;
if( strncmp( bufferName, OUTDIR, strlen( OUTDIR )) == 0 if( strncmp( bufferName, OUTDIR, strlen( OUTDIR )) == 0
|| strncmp( bufferName, WORKDIR, strlen( WORKDIR )) == 0 || strncmp( bufferName, WORKDIR, strlen( WORKDIR )) == 0
......
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