diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-12-18 14:06:42 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-12-18 22:43:28 +0100 |
commit | dbbd2c48b157214fd3e4b912e25ffd0b02976fa4 (patch) | |
tree | 4560ea3517b2747a1f02401b9b5c1cb9e6aa5b42 /compilerplugins/clang | |
parent | f2ef97dee758cb7b9360ebef08d59672b5e56b0d (diff) |
Work around problem with poor gperf-generated code under clang-cl
Change-Id: Iba3fae8bbecaf5782228be1fb99f196864d79e6b
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/plugin.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx index 143897b499d5..d5b2401c8bf9 100644 --- a/compilerplugins/clang/plugin.cxx +++ b/compilerplugins/clang/plugin.cxx @@ -41,8 +41,19 @@ bool Plugin::ignoreLocation( SourceLocation loc ) if( compiler.getSourceManager().isInSystemHeader( expansionLoc )) return true; const char* bufferName = compiler.getSourceManager().getPresumedLoc( expansionLoc ).getFilename(); - if( bufferName == NULL - || strncmp( bufferName, SRCDIR "/external/", strlen( SRCDIR "/external/" )) == 0 ) + if (bufferName == NULL + || strncmp( bufferName, SRCDIR "/external/", strlen( SRCDIR "/external/" )) == 0 + || strcmp( bufferName, SRCDIR "/sdext/source/pdfimport/wrapper/keyword_list" ) == 0 ) + // workdir/CustomTarget/sdext/pdfimport/hash.cxx is generated from + // sdext/source/pdfimport/wrapper/keyword_list by gperf, which + // inserts various #line directives denoting the latter into the + // former, but fails to add a #line directive returning back to + // hash.cxx itself before the gperf generated boilerplate, so + // compilers erroneously consider errors in the boilerplate to come + // from keyword_list instead of hash.cxx (for Clang on Linux/macOS + // this is not an issue due to the '#pragma GCC system_header' + // generated into the start of hash.cxx, #if'ed for __GNUC__, but + // for clang-cl it is an issue) return true; if( strncmp( bufferName, WORKDIR, strlen( WORKDIR )) == 0 ) { |