After we moved some of the code to HeaderPathFilter we now use it in
CompilerOptionsBuilder.
Task-number: QTCREATORBUG-21693
Change-Id: Iea3569465bbc135d72bd88f9c23026f2ace33aba
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
These are files that are included like headers, and not compiled
themselves, so e.g. adding them to a project should not categorize them
as source files.
Fixes: QTCREATORBUG-21736
Change-Id: I7dafba02896d12160de5eed458b99144df0a5f37
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
We went the filtering of the header path outside of the compiler options
builder so merge the PCHs.
Task-number: QTCREATORBUG-21693
Change-Id: Ia1126813a5049e39d7c6e7d60bf449aa17012d02
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
We are always interested in currentTabSettings().
Fixes: QTCREATORBUG-21280
Change-Id: I5b739b516eb985074c27410113c244787dd8b52d
Reviewed-by: Marco Bubke <marco.bubke@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 clang code model and clang tools use case.
This means that compiler detection code will see clang now instead of
the toolchain that is configured in the kit. While providing the
toolchain macros worked fine for the general case, it always was
problematic for compiler detection code.
By not providing the toolchain macros we are more close to the real
clang compiler invocation. That is, rely on clang to do the right thing.
Allow to go back to old behavior with QTC_CLANG_USE_TOOLCHAIN_MACROS=1
as this will be useful checking differences for debugging.
Fixes: QTCREATORBUG-19543
Change-Id: I23ffd761d83f35ca1a22269c3ef07a2dc62358bd
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@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>
It makes sense to unify the indenter creation by replacing
the CppCodeStylePreferencesFactory instead of removing it.
We are reusing the same options page but with different
kind of settings.
With this change wizards will no more be confused by missing
factory and will create the proper indenter.
Fixes: QTCREATORBUG-21516
Change-Id: I38964d5fa1f2257617c66a1441db723d239a3237
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@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>
It's used while building so let's also do that in Clang Code Model.
Change-Id: I4e5e3ccc71d14c8d44049672e37380af2592390f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Boost recognizes a misconfigured compiler in rtti emulation mode
(-fno-rtti) as our libclang command line is special. Even worse, it does
not seem to stop instantiating templates and allocating memory
afterwards.
For the former to fix, we need to rework our command line (in master).
The latter can be work arounded by defining
BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING with a value for gcc/clang.
See also
https://www.boost.org/doc/libs/1_64_0/doc/html/BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING.html
Task-number: QTCREATORBUG-19543
Change-Id: Iddb5be2d1f1966018e5ab535a8f7475fe7911284
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
We can't stop the clangbackend from processing huge files, but at least
our built-in parser.
Fixes: QTCREATORBUG-21590
Change-Id: I506024495ba0632692f2845c6c204360f4c61b33
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
CppEditor tests (the part which works with ClangCodeModel) showed
that it's possible that QTextCursor might get document reset
to the moment we try to call built-in follow symbol. That means
that the editor widget is closed already.
Check for the document to prevent such behavior.
Change-Id: I2463f4688dc6fca7f701fba243ffc6e43a573b33
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Follow up for 8469e317c9. This column number compensation
is not required anymore.
Fixes: QTCREATORBUG-21384
Change-Id: I94da48533520471170200c592129781e5b4b614c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@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>
The Preprocessor running in a worker thread can call this function.
Fixes: QTCREATORBUG-21481
Change-Id: I4970379fbabae23cfa3d7c1222e81a4ae8c3e6ad
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Use alias to shorten the repeating default return value.
Change-Id: I673fc1d293c1612c945c80d554c6667a756108de
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
The calling code can anyways fallback to the global style
without extra help if no project style exists.
It is useful when you want to get the project style if it exists
and understand at the same time that it is not a global one.
Change-Id: I265de3f436f90623385427fc8a1abad09c8c3577
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Was introduced in 0e5c7f51fa with the page being deleted
to remove it from the global list of pages.
Change-Id: Ia13f7ab74d85b5b8c66f1b20e33d97c29ce3e8f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
convertPosition change was introduced in 931ec39f64.
It changed 0-based column to 1-based which is how it
naturally is in Qt Creator.
This fixed some usages but broke many more. This is an
attempt to fix the remaining use cases.
Fixes CppEditor auto-tests.
Change-Id: Ia8d14da0ebb035cd2fdd6da4ff6ec89c1c5121a8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
And remove UI for default code style settings because
it does not affect anything when ClangFormat plugin is
enabled.
Change-Id: Ie348b7d2691b09ea2b4868da987f2a27347ea0f3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
1. Create some Qt Console Application from the wizard
2. Open Tools > Options > C++ > Code Model
2.1 Click "Manage..." and create a custom configuration "custom" and
finish with OK.
2.2 Set "custom" as diagnostic config.
3. Analyze > "Clang-Tidy and Clazy..."
3.1 Use "Custom Settings"
3.2 Click "Manage..." and remove "custom" ==> Crash
The crash happened because the code model used an invalid diagnostic
config id. The invalid id came from the settings, which were not
correctly upated.
Fixes: QTCREATORBUG-21273
Change-Id: I5242f7c92e121eec8558fa7923139bb3d759c676
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
The diagnostic id might not match any diagnostic configuration in the
settings as Qt Creator prior version 4.8 could have written it
inconsistently. We need to correct this case.
Task-number: QTCREATORBUG-21273
Change-Id: Ic9e21f70bca94da6d9afb30f0b2bfd5024d16fdd
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Extract headers, defines and fileKind from flags in
order to have complete project parts.
Side-effect: better support for MSVC-specific flags.
Change-Id: Iaa1413c91c96c3cf89ddbe76a7a1f0f46c5289c0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
It was checked that pure C header and source files had proper
language version but not another way around.
Change-Id: I1eaf41f342731bdbe30ee73e81144334d0f15d19
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
If the project has no PCH it has no effect, and if it does have PCH it is
typically important to use it.
Change-Id: I20ce2a0c5713253d2754d31e7b7dca51696b208b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This trick is needed only for internal purposes.
Change-Id: Ic10c0898519eed663d14c4b1665a0d6b0d47b4a4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Since we now ship clang 7 binaries, let's open the docs accordingly in
the browser.
Change-Id: Idfd8967fbbadfee87df6f7e721e1ee13ea15de87
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
We use "Builtin" and "Clang" as prefixes, not suffixes.
Change-Id: I6926aeb8f005176ef420c4421c257e3df61ee0b7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
As an addition update the header with Clang-Tidy checks.
Change-Id: Ib4a4d324e8cad95403a3e799e352205b05ed7475
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
...to reduce file locking on Windows caused by clangbackend's
parse/reparse jobs.
Considering inactive application state should help for external VCS
operations, e.g. on the command line. However, activating Qt Creator
while such a VCS operation runs might still lead to undesired behavior,
but this should be the less common case.
VCS operations started from within Qt Creator should see less locking
conflicts as we know when they start and finish. However, we just avoid
starting new jobs - there might be still jobs running.
Pending or new jobs will be started once Qt Creator is activated again
and all VCS operations finished.
Task-number: QTCREATORBUG-15449
Change-Id: I5f04c34f006e66162368efbdd58bd822a706f35e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Instead, set the default level of all logs to QtWarningMsg.
The call to setFilterRules overrides the user preferences in qtlogging.ini.
Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@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>