summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-01-07 12:24:58 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-01-11 14:58:58 +0100
commitd9a5c6bdf0106c9cf7eb6a94c8ed0b68867b29e9 (patch)
tree8427d87507edd03d57391a85001ebfb7d3404626 /compilerplugins/clang
parent3527efa7e078ce11ac537d8f8591b159c05e760f (diff)
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
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/plugin.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 7c4256b9f73d..db9521f8dac3 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -55,9 +55,8 @@ bool Plugin::ignoreLocation( SourceLocation loc )
SourceLocation expansionLoc = context.getSourceManager().getExpansionLoc( loc );
if( context.getSourceManager().isInSystemHeader( expansionLoc ))
return true;
- bool invalid;
- const char* bufferName = context.getSourceManager().getBufferName( expansionLoc, &invalid );
- if( invalid )
+ const char* bufferName = context.getSourceManager().getPresumedLoc( expansionLoc ).getFilename();
+ if( bufferName == NULL )
return true;
if( strncmp( bufferName, OUTDIR, strlen( OUTDIR )) == 0
|| strncmp( bufferName, WORKDIR, strlen( WORKDIR )) == 0