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
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user