summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/compileroptionsbuilder.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Clang: Take precompiled headers into account when parsing source filesDenis Klychkov2016-11-161-0/+7
| | | | | | Task-number: QTCREATORBUG-15590 Change-Id: Icbfce4ffd6e9f9802641d35d898fa1dc1c4c18ee Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang*: Workaround parsing mingw's <type_traits> with clang 3.9Nikolai Kosjar2016-10-181-0/+2
| | | | | | | | | | | | ...for -std=gnu++0x. Define the unknown identifier/type "__float128" so at least the headers can be parsed successfully. Of course this does not help for parsing client code referencing that identifier, but this should be the less common case. Task-number: QTCREATORBUG-17126 Change-Id: Id321311713029d8aa77e068b02361d86debfada6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clang: Avoid running into gcc/mingw intrinsicsNikolai Kosjar2016-10-181-0/+2
| | | | | | | | | | | | Same as for the Clang Static Analyzer, so move the implementation into the base class and use it. This has gone unnoticed so far because it looks like that the error diagnostic from the bug report can be extracted with libclang (as shown in the info bar), but is not printed from libclang or clang.exe itself. Change-Id: I5b714ba374c5fdefe234faf012a3515e96c9a08c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clang: Fix parsing MSVC's crtdefs.h for 64 BitNikolai Kosjar2016-10-181-0/+1
| | | | | | | | | | | | | ...by specifying the word width, as for the Clang Static Analyzer. This has gone unnoticed so far because it looks like that the error diagnostic from the bug report can be extracted with libclang (as shown in the info bar), but is not printed from libclang or clang.exe itself. Task-number: QTCREATORBUG-17130 Change-Id: Ia7a5ee3825c7211cdf80c2166a9eb454ce48cac1 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clang: Use compiler specific undefine optionNikolai Kosjar2016-10-181-0/+1
| | | | | | | | | | | | | libclang generated: warning: /U__cpp_aggregate_nsdmi: 'linker' input unused [-Wunused-command-line-argument] warning: /U__cpp_alias_templates: 'linker' input unused [-Wunused-command-line-argument] ... It needs -U. Change-Id: Ibbd2f97e6f806215e3008803f57608b9b6b4c641 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Avoid "defineLine" in CompilerOptionsBuilder APINikolai Kosjar2016-10-171-3/+3
| | | | | | | ...because it might suggest to append a new line. Change-Id: I8d5701a1d20c9d94ee528383227a6e3b446b4ff2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Always pass in header paths as native pathsNikolai Kosjar2016-10-171-1/+1
| | | | | Change-Id: I473c737107c14a4bc2c78b7c697eef02eb4bacff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangStaticAnalyzer: Stop passing on toolchain defines for qmake/msvc caseNikolai Kosjar2016-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-produce with: 1) Open qt-essential-includes.pro and configure it with a Qt 5.7.0 MSVC2013 64 Bit Kit. 2) Run the analyzer. Errors during analyzing occur in winnt.h [1]. This is somehow related to /D__int32=long that we pass on. Removing it helps. It looks like there is no reason anymore to pass on the toolchain defines with clang-3.8 at all. Our unit test projects can be parsed by the analyzer without them. Tested with the following kits: Qt 5.6.0 (mingw39_32) Qt 5.6.0 (msvc2013) Qt 5.6.0 (msvc2013_64) Qt 5.6.0 (msvc2015) Qt 5.6.0 (msvc2015_64) Qt 5.7.0 (mingw53_32) Qt 5.7.0 (msvc2013) Qt 5.7.0 (msvc2013_64) Qt 5.7.0 (msvc2015) Qt 5.7.0 (msvc2015_64) [1] In file included from D:\dev\creator\creator-4.1\src\plugins\clangstaticanalyzer\unit-tests\qt-essential-includes\main.cpp:2: In file included from D:/usr/qt-5.7.0-msvc2013_64/5.7/msvc2013_64/include/QtGui\QtGui:32: In file included from D:/usr/qt-5.7.0-msvc2013_64/5.7/msvc2013_64/include/QtGui/qopenglcontext.h:60: In file included from D:/usr/qt-5.7.0-msvc2013_64/5.7/msvc2013_64/include\QtGui/qopengl.h:49: In file included from D:/usr/qt-5.7.0-msvc2013_64/5.7/msvc2013_64/include\QtCore/qt_windows.h:61: In file included from C:\Program Files (x86)\Windows Kits\8.1\include\um\windows.h:164: In file included from C:\Program Files (x86)\Windows Kits\8.1\include\shared\windef.h:24: In file included from C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h:182: C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(3077,1) : error: functions that differ only in their return type cannot be overloaded __getcallerseflags ( ^ D:\dev\llvm\3.8\changingLibClang_install\bin\..\lib\clang\3.8.1\include\intrin.h(68,14) : note: previous declaration is here unsigned int __getcallerseflags(void); ~~~~~~~~ ^ 1 error generated. Change-Id: I2de8d0393a575f88dd59dfa71fbfb11f2debc158 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Clang: Pass on file paths with native separatorsNikolai Kosjar2016-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/4.0'Eike Ziller2016-04-151-0/+4
|\ | | | | | | Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
| * Clang: Enable exceptions explicitlyNikolai Kosjar2016-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Clang: Undefine language features as fix for MSVC2015/clang-3.8.0Nikolai Kosjar2016-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | This applies the following change for the clang code model, too. commit d13d1795241602ca0cf150b216b282cfb15e406d Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0 II Change-Id: Ia229d7e8b24c2e1c0a83d9a53c623ea1f79c4a06 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
| * Clang: Set -fms-compatibility-version explicitlyNikolai Kosjar2016-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 daf08d8702905335e3fc63c629f917e99715b915 Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0 Change-Id: I9d34abdbe2c83fe271eadd8d051caad43aca6772 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
* | Merge remote-tracking branch 'origin/4.0'Eike Ziller2016-04-121-0/+1
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
| * Clang: Explicitly set the target tripleNikolai Kosjar2016-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Wholesale conversion to #pragma oncehjk2016-03-301-4/+1
|/ | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CppTools: Moving CompilerOptionsBuilder in its own header fileMarco Bubke2016-01-131-0/+75
Change-Id: I503ffd72a98db6668f6449ce95e695e035a79a29 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>