Commit Graph

853 Commits

Author SHA1 Message Date
Nikolai Kosjar
1d010e2686 Clang: Remove unused member
Change-Id: Ib9af2f32bc69c34570d5276f03b660111ec3fe1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-05 12:49:14 +00:00
Christian Stenger
49525c578c Unify disabling build of llvm related plugins or test on Windows
If libclang's build mode mismatches the current build mode
of Qt Creator some plugins are automatically disabled.
Do the same for the unittest and unify the way to do this.

Change-Id: Ib4cd6494ed63cb89ed8d99b3c0ba23a19572fc9b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-07-05 12:46:27 +00:00
Tim Jenssen
1df6443d4a Merge remote-tracking branch 'origin/4.10'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/libs/utils/synchronousprocess.cpp
	src/plugins/baremetal/iarewtoolchain.cpp
	src/plugins/cmakeprojectmanager/cmakeproject.cpp
	tests/unit/unittest/CMakeLists.txt

Change-Id: I124ad492df403286751e175d27fe36487ddf6d07
2019-07-04 15:17:55 +02:00
Marco Bubke
376aae2711 Clang: Remove old code
We maybe bring back the clang query interface but the local rename is
better served by other plugins.

Change-Id: I97bedcb20870632b7dd50977794a65b2b09ededb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-07-04 08:41:10 +00:00
Marco Bubke
f864c7a0d8 ClangPchManager: Don't update system PCH if no system include file changed
If a project or user file is touched the system PCH should not be
regenerated.

Change-Id: Id5989735bab4441fc1eebfb5d31e01ba9714428b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-07-04 08:40:57 +00:00
Marco Bubke
cc87615fcd Clang: Differentiate between user and non user includes for updating
We don't want to recreate a PCH if the include or source is not
contained by a PCH.

Change-Id: If52fc1aed92054b4165cdc634656147fbe8baa47
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-07-04 08:40:45 +00:00
Cristian Adam
b519dc541a CMake build: Fix building with CMake
Change-Id: Ib1ba9d286a029d20106d105b3db7fb34596badbd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-07-01 07:43:04 +00:00
Eike Ziller
10098b2508 Merge remote-tracking branch 'origin/4.10'
Conflicts:
	CMakeLists.txt
	tests/unit/unittest/unittest.pro

Change-Id: I64296ad31502d9b35012da129a28e9277e9fcf8e
2019-06-28 12:50:03 +02:00
Marco Bubke
e777ad57c5 Clang: Add reset to ModifiedTimeChecker
We can reset some file once to flag a file dirty if the included file has
changed.

Change-Id: I8763bb80f65882fba4e70057f569234e77097927
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-27 12:32:22 +00:00
Marco Bubke
e031ada154 Clang: Watch only PCH sources
We watched all sources but we do not want to watch the sources of the
project part because they are not used to build a PCH.

Change-Id: I700cd6077fc54230c9be94d620043cf3f10cf9ea
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-27 12:32:12 +00:00
Marco Bubke
cbfd9dc16b Clang: Update ModifiedTimeChecker in SymbolIndexer
If a watched file changed we should update the ModifiedTimeChecker too.

Change-Id: Ie43f5cf5b6dd4ddb1383168a1326add21f6e3e9d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-27 12:32:02 +00:00
Marco Bubke
bbd58ca30b Clang: Watch directories instead of files
Because there a limited resources to watch files we watch now directories.
So we need much less resources.

Change-Id: Iac558832e9521a7a1a67c5ea99b42ad1b0b5129c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-27 12:31:52 +00:00
Marco Bubke
98d7b502ca ClangRefactoring: Clear input files after collecting symbols
Change-Id: Ic4fbaac7ad3b3f80223d6cbb84a34dffa741fc4f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-26 12:21:24 +00:00
Christian Stenger
64e842759b Unittest: Silence most of the warnings on Windows
There are lots of warnings coming from including
or linking against LLVM which cannot be influenced
directly. Silence most of the warnings to be able
to work with the mess.

Change-Id: I2c4adec14945ada878bb1e6fda2f06e6d56007e2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-06-25 07:36:47 +00:00
Eike Ziller
917636b88b Merge remote-tracking branch 'origin/4.10'
Conflicts:
        src/libs/utils/consoleprocess.h
        src/libs/utils/consoleprocess_unix.cpp
        src/libs/utils/consoleprocess_win.cpp
        src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp
        src/tools/clangrefactoringbackend/source/symbolscollector.cpp
        tests/unit/mockup/projectexplorer/project.h

Change-Id: I8d10f26b9bcb54829ba31cdc2272885691df1e16
2019-06-18 12:30:55 +02:00
hjk
ce40c84a38 Fix projectupdater unit test
Amends 35fa8aa802.

Change-Id: Ic791959c4bce66bf9b8b1b43e60c86268c33a029
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-06-17 12:44:42 +00:00
Marco Bubke
300feced20 ClangRefactoring: Activate updating for indexing
Change-Id: I6fb818edfab8ef7d9cfab0520276acedf0597fd3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-17 10:50:00 +00:00
Marco Bubke
ee27ae2ef7 ClangRefactoring: Improve indexing
Fix some bugs in the indexing and use the new macro indexer from clang.

Change-Id: I2ba1b28097a8751aea942071851a60d164c6f371
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-17 10:49:49 +00:00
Marco Bubke
b36e9d0e95 ClangPchManager: Improve handling of no include in project PCH
We were doing simply nothing but we should call
PchCreator::doInMainThreadAfterFinished().

Change-Id: Ia21d2cf4af53121d9e401f6e9a5b432a4daed00f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-17 10:46:31 +00:00
Marco Bubke
b213dee013 Clang: Improve updating
If project parts are up to date we send them directly to the indexer, so
the indexer can decide we something needs an update.

Change-Id: I7d4f32794c6b3a861cdefb3653a6dfd4e711f619
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-17 10:46:21 +00:00
Marco Bubke
912cb9278f ClangRefactoring: Ensure that database is written to log after indexing
Change-Id: Ic2473d9fe8dc9b41a7da728c9e1b5202524c1a79
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-17 10:46:12 +00:00
Cristian Adam
84659016e7 CMake build: Build fix for "Enable macro editing for the Clang indexer"
Change-Id: I69396e306d1b8646fa4388681a8705937bf9423f
Reviewed-by: hjk <hjk@qt.io>
2019-06-14 10:46:23 +00:00
Marco Bubke
4bae5de36b Enable macro editing for the Clang indexer
Refactor much of the code from Environment* classes to NameValue* classes
to share it with the preprocessor macro settings.

Change-Id: Ica4ee817aa338230c422b30d91240d266248d226
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-13 16:51:48 +00:00
Marco Bubke
e904fc202c Clang: Filter macro QT_TESTCASE_BUILDDIR out
We have to universalize it later with a UI so that user can set their
own macros.

Change-Id: I5385c3c1b01dbf77a1cbc2431103fcdea3f96118
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-06-05 13:54:21 +00:00
Cristian Adam
0439eea6bc CMake build: Skip installation of test plugins / executables
Our tests run from the build folder. We do not need to install them.

Change-Id: Iaeb27e466fe0d43bc15fa3eee3bf6d2659b87083
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-06-05 08:28:49 +00:00
Christian Kandeler
e6bda58033 CompilationDBProjectManager: Handle relative sysroot
Fixes: QTCREATORBUG-22388
Change-Id: I030b105897bd483c17aaf86229d4515b2dd747d3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-06-04 10:17:44 +00:00
Cristian Adam
f50859e856 CMake build: Add unittest CMake build files
On MinGW 8.1 I get the following after running ctest -j 40

99% tests passed, 35 tests failed out of 2631

Change-Id: I2c3ce7940b036e52ef393feab5837886355e7b5a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-29 13:46:25 +00:00
hjk
35fa8aa802 Fix projectupdater-test.cpp after FileName changes
Change-Id: I43974405522facd46a757ba4cf2886128310597c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 16:49:29 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Nikolai Kosjar
0bac3ad279 C++: Do not auto-insert '}' after control flow constructs
...as this rather gets in the way.

As before, pressing ENTER after { will still auto insert } on the next
line.

Fixes: QTCREATORBUG-18872
Change-Id: I8ee082962b5ee82781e51c3e5ee146343f808332
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-05-28 07:36:09 +00:00
Christian Kandeler
0ffbe6a9e4 CompilationDbProjectManager: Sanitize project parsing
The parsing code used to access all kinds of stuff (e.g. the project
tree and the toolchain manager) from the non-UI thread, which is not
allowed.

Fixes: QTCREATORBUG-22420
Change-Id: I4be47919d7e543376d31826dd380f66f4e060458
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-05-23 08:56:16 +00:00
Nikolai Kosjar
eb1aa8dcca UnitTest: Fix ProjectInfoGenerator.* tests
This amends e3def98c00.

Change-Id: I21deb74fe4a4387f7490c806e0990bafd06438bf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-05-21 12:54:12 +00:00
Orgad Shaneh
fc11380e07 Fix unit tests compilation + initialization order
Amends commit cc9d246b02.

Change-Id: I688df432cd03f440ec6c15ca5402d94430ce74f8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-05-03 06:21:44 +00:00
Ivan Donchevskii
d4c5a6f9b2 CompilationDatabase: Fix unit-test
Change-Id: I2a2e2b5ead35236f11e6f9f0ec15608b30335fd1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-04-30 12:46:41 +00:00
Marco Bubke
24cadba480 ClangRefactoring: Fix indexing
We moved inside of loop so projectPart was used many times but was empty
after the first iteration.

Change-Id: Ie2441dbdd3bb9de73ae1fd076626255599f5dfea
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-29 12:52:13 +00:00
Marco Bubke
2d520140d0 Clang: Fix system pre include search path
We now get the resource path from creator. The -fPIC case is working now
too.

Change-Id: Id191e89e6d46706748d50440038a06a349972cc9
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-29 12:52:05 +00:00
Marco Bubke
1975641a3d ClangPchManager: Remove target triple
We don't need it so far and it is creating trouble.

Change-Id: Ia502452717b5be935e4ba2cd2de04007e4144199
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-29 12:51:58 +00:00
Marco Bubke
facda6f502 ClangPchManager: Don't generate PCHs if there is no include
Change-Id: I88caab6ff188b64d92a74d61276c4724c33cae23
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-29 08:57:10 +00:00
Marco Bubke
eaaff9da7e Clang: Reindex without PCHs if error are occurring
If an occurs we first reindex with the system PCH only and if it is still
occurring we are indexing without any PCH.

Task-number: QTCREATORBUG-22011
Change-Id: I815ee3abe7829aaeb191d985cd045bac35015893
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:09:06 +00:00
Marco Bubke
16d5bf0afc ClangRefactoring: Move transaction in fetchPrecompiledHeader
Prepare the move of fetchPrecompiledHeader in the lambda to execute it in
the thread.

Change-Id: I00f906196dabfdb5cd38f4b9752d92678236b849
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:50 +00:00
Marco Bubke
3fc8217113 Clang: Refactor fetchPrecompiledHeader
We don't need the other information any more.

Change-Id: Ie34a646df34e336591c124093a15e90307ac88ec
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:44 +00:00
Marco Bubke
5ab057746c CppTools: Add pre system include search path per project
Sometimes you want add a pre system include search path per project to
overload some system header for indexing. This can then even be checked in
the repository.

Change-Id: Ib103e5935d0553aa94522ed736f8c4eb2405a093
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:33 +00:00
Marco Bubke
3bd653416a Clang: Add global preincludes search path
Some header like windows.h adds dangerous defines which are not used but
break the indexing like "small". We now preinclude them and undefine the
dangerous the defines. This can be used for speed up the indexing as we
could provide stripped headers.

Change-Id: I2a89a4719ada7591e0e7a1ecc411b2e0ffd40d9a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:25 +00:00
Marco Bubke
0fbc16cd7d ClangPchManager: Fix alive message
Computing the dependencies can take quite some time. So it is better
to ensure that the alive timer is fired.

Change-Id: I0b372ef73a8a5e6716673ba9457d424151a762bb
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:15 +00:00
Ivan Donchevskii
9d4c7b1c42 Unit-test: Fix build
Change-Id: Id89bbd391117d998bb6e8d4607786ac48580a7f4
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-04-18 14:29:07 +00:00
Ivan Donchevskii
53c407bc0c Clang: Fix build with clang-8
Clang-Tidy checks and Clazy flags updated.
CLANG-UPGRADE-CHECK done.

Change-Id: I1ca585c5c3c77a7f183719df9c262603150914e8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-04-17 12:13:36 +00:00
Orgad Shaneh
f213f6176b UnitTest: Fix compilation
This amends commit a5ee354b19.

Change-Id: I29938d30187fde1ac05d824276cb4b02b561645a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-17 04:34:31 +00:00
Marco Bubke
71e6c40cc2 UnitTests: More QString fixes
Change-Id: Id1c60dfa8b3ada2c855f43437a153042cfec9f63
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-04-08 22:15:04 +00:00
Orgad Shaneh
39ba01da71 Merge remote-tracking branch 'origin/4.9'
Change-Id: I7d1912cd5c4d824fd40d3454c5f1bb796f2c21d8
2019-04-07 23:13:17 +03:00
Marco Bubke
dce3e9708c UnitTests: Allow cast from char* to QString
Otherwise it is not working for older compilers and Qt versions. We can
revert it if we drop support for that old versions.

Change-Id: I0f71e05235e9ff24cee28131654c9b6df9997643
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-04 10:48:23 +00:00