Kaydet (Commit) dbbd2c48 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Work around problem with poor gperf-generated code under clang-cl

Change-Id: Iba3fae8bbecaf5782228be1fb99f196864d79e6b
üst f2ef97de
......@@ -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 )
{
......
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