For GCC it can be deduced from the compiler flags, so no correction is
needed.
For MSVC it can be deduced from the detected defines.
Amends 26693e8212.
Change-Id: Ie4850f328a2afdb3e5158c58f8c30a2644d9c592
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The getClangResourceDirAndVersion() function in ClangTools could return
the actual resource dir or the include dir, depending on the input. This
mistake happened because of misleading names spread all around the code.
Now the function returns what it says, and the other names are accurate
as well.
Change-Id: I0a8600857ee7b9fafb16256e0d1ad203ac3273d2
Reviewed-by: David Schulz <david.schulz@qt.io>
Prevent mingw from trying to #include_next a private header from a path
we cannot add to our list of includes.
Fixes: QTCREATORBUG-24251
Task-number: QTCREATORBUG-24027
Change-Id: I18a9db130b9c2265cd208c3506d08d2e1c4cee45
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This reverts commit b114f77d8a as
"--driver-mode=cl" apparently still disables exceptions.
Task-number: QTCREATORBUG-23000
Change-Id: I9c49d971fafda5e1aca8445f8921e50f323d368f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Leave the function addExtraCodeModelFlags() around as it's used by
ClangPchManager::ProjectUpdater::toolChainArguments().
This allows us to filter out excess target arguments in a follow-up
change.
Change-Id: I742d713dd1ca6c391ba77c52555dcf4e94cc2ff9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* The paths on Linux are always "canonicalized" by
GccToolChain::gccHeaderPaths(). Therefore, canonicalize the paths in the
tests, soo.
* Introduce some helper functions to shorten the code.
* Do not break the strings literal paths as this complicates comparing
them.
Change-Id: I0fc8acde0e455a7974baae0d9fdffd3a4060ff74
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
...also on Linux.
That's what clang invoked from the command line does.
Change-Id: I59c48d11fab3b944bb42ca7bb4cd9093a735df60
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
QtVersion to utils/cpplanguage_details.h which already contains similar
flags.
BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the
same header to not pull that in everywhere).
Removes dependency on ProjectPart from RawProjectPart.
Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
We need to provide built-in includes only when we use tweaked headers.
Also let's require Clang resource directory because it has to be
placed on the specific position inside the built-in header paths.
Change-Id: Id581238660c680725201de759216cf33f69f6cc7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
The known cases provide enough flags not to require
toolchain defines.
Change-Id: Ia7e08a90eca6ea9474db40683ac1e63236f8643d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Clang has MSVC compatible mode which works with MSVC style command line
flags.
When possible use the same flags (-I, -D, -U, etc.) and in other cases
either replace by MSVC analog (for example use /FI instead of -include)
or pass the argument with '/clang:' prefix (requires
https://reviews.llvm.org/D53457).
Change-Id: I95f33bed5dc8d9493895ed8d4359cdd70fc774b8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Rely on clang to do the "right thing" with them.
Change-Id: I44adf2cd5c61549896da3fc9b7c35c2fb0142060
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
We want to use them in the backend processes too so it's nice to share them
in Utils. A concrete size was added too because they should be serialized.
Change-Id: Id5eb8f46643d5159f034fc9559f68a08d7e5847a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
According to commit e2e3be09e3 this was
needed for clang 3.8.0 on Windows.
Change-Id: I4f2c2bf31449d9613607e57524c7ff6e4577812a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
C++ includes must always come first, then clang resource
directory and then everything else.
This prevents both c++ standard headers and intrinsics issues.
Change-Id: Ia21bfa2fe99884c9adf58f7ef6beba1bede1724b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
...for clarity.
No behavior change.
Change-Id: Id0334bc79b97a8ff53b37089e337530c9a01b1d4
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
No behavior change.
Sometimes we use "SkipX, sometimes "UseX". Unify to "UseX" as this is
more natural to read.
Change-Id: Ib08bdb4cde93ed55fdb9c855566b10a3933cae37
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
No behavior change.
* Remove virtual from methods that are not overridden
* Move constant member functions that do no access any members into
source file as static functions
* Remove QLatin1String where possible
* Make variable names a bit more consistent
* Other minor stuff
Change-Id: I34a582d5a468489e11365507b283e9aee157664f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Take into account paths from MinGW and NDK Clang.
Fixes: QTCREATORBUG-21540
Change-Id: I00906c75dc4ddeb92fe5942a0222285d8ce2eb9d
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
For the indexing we need all tool chain macros. Originally it was a fix
because the C++ version of the project part and __cplusplus could be
different but now they should be the same. They will be now removed in the
compiler options builder.
Change-Id: I7ae8721a29632473e76ecedb411a6c9001e5e199
Task-number: QTCREATORBUG-21265
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Match paths partially not to construct the whole path.
Change-Id: I397ac930e2d74b8eba98d1b523aabd4ed92f2aee
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
... between CppTools::ProjectPart and ProjectExplorer::ToolChain.
Change-Id: I8b448747e454adbed77547460383b8515462cc81
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>