libclang 3.8 seems to be sensitive to file paths separators [1]. On Windows,
this led to not updated document annotations and/or crashes after reparsing.
When passing file paths to libclang, convert to native separators.
When getting file paths from libclang, convert back.
This handles:
* main file path
* file paths of the unsaved files
* -I<DIR> arguments, the resource path (for builtins) and the paths to the
wrapped qt headers
* included header files from libclang
* source locations from libclang
Also, minimize the conversion in SourceLocation to a minimum by making
filePath() lazy.
[1] https://llvm.org/bugs/show_bug.cgi?id=28381
Change-Id: If5866f34a6fdc6b34b16c022d3988e8e6eae2a0a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
For some reason, clang 3.8.0 on Windows does not enable exceptions anymore,
which leads to parse errors in MSVC headers (reported upstream [1]).
With this change, we can finally parse main/mainwindow.cpp of a Qt Widgets
Application for a MSVC2015 Kit and libclang 3.8.0 without any error.
[1] https://llvm.org/bugs/show_bug.cgi?id=27324
Change-Id: I532ad4852a06318baf083d363378bc577b3c4309
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This applies the following change for the clang code model, too.
commit d13d179524
Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0 II
Change-Id: Ia229d7e8b24c2e1c0a83d9a53c623ea1f79c4a06
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Infer the version from the _MSC_FULL_VER macro, so it cannot get out of sync
with that.
Adapt the analyzer to do the same.
Based on
commit daf08d8702
Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0
Change-Id: I9d34abdbe2c83fe271eadd8d051caad43aca6772
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
As for the analyzer, this makes us independent of the default triple and will
most likely reduce the maintenance - e.g. the target implies certain internal
command line arguments, we will profit from added ones.
This fixes parsing of mingw headers with the clang code model.
Change-Id: I722b981125a80fac5f62a7af40a83ecdd7bbf811
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>