Commit Graph

163 Commits

Author SHA1 Message Date
Orgad Shaneh
1e138fbe10 Remove excess blank lines after namespace
Change-Id: I4e4f83017f2bfc2cf842c4c971ed4b05e0447e6a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-27 06:50:16 +00:00
Tobias Hunger
c1488bbc25 Clang: Sprinkle some overrides over the codebase
This silences several warnings.

Change-Id: I0a15ee833ea4c3de4e6adafb72e530a2c4577b09
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-05-13 10:34:29 +00:00
Orgad Shaneh
fffffad325 ClangRefactoring: Remove redundant std::move
Detected by GCC9.

Change-Id: I12b4de063a736d17fb6a7105d622812df1981a1a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-05-11 17:50:05 +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
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
5a6a9343b5 ClangRefactoring: Move command line generation in worker thread
Because we want to retry to index without the PCH we need to move the
command line generation in the worker thread.

Change-Id: Ifd018be277081ee676e5fa51af9e6ee99bbc6724
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:57 +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
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
Marco Bubke
56b01f7463 Clang: Minimize reindexing
We optimal indexer is only reindexing if the index would be changed. This
patch is a step in that direction. We only reindex now if the file or
project has changed. It fixes some typos too.

Task-number: QTCREATORBUG-21150
Change-Id: I6ea1c13282fbcd70253b9b2939aed37580dbd160
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-02 13:08:44 +00:00
Marco Bubke
7595c9f305 ClangPchManager: Handle non generated PCHs
Sometimes we start generation of PCHs but not finish it. In that case we
should redo it at the next start of the backend process. So we now
remove the old precompiled header if we add the task to the queue.
If we successfully generated the PCH it will be set again. But if we
did not it will be read from the database and set to false.

Task-number: QTCREATORBUG-22035
Change-Id: Id53c2b4e4f501fc5ef7830558085607baa6a49f1
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-02 12:38:12 +00:00
Marco Bubke
6effa1822b Clang: Improve project part updating
The project part ids are now already created very early in the database.
This removes some checks because we can assume that an id already exists.
The project part are now completely persistent, so we can read them from
the database and compare them with new generated from a new creator
session. This should help to not recreate the same PCH again and again.

Task-number: QTCREATORBUG-21151
Change-Id: Iced818ff9f7431eaed3e37978087cc0a43b9afda
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-01 10:31:38 +00:00
Marco Bubke
1a63297d9b Clang: Improve dependency building
We want to use the cached values in the database because it is faster than
to parse the the files again.

Task-number: QTCREATORBUG-22035
Change-Id: I7ada7073887b1d89a06332fdb617701cb69ccd68
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-03-06 11:24:20 +00:00
Marco Bubke
2358415b58 Clang: Move fetchPrecompiledHeader to PrecompiledHeaderStorage
It went for historical reasons in the symbol storage.

Change-Id: If05edb868901884f3951d0eb2f152566e99b4d1a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-03-04 13:40:39 +00:00
Ivan Donchevskii
2c6bda5950 ClangRefactoring: Map unsaved files with non-native paths in ClangTool
Otherwise the ClangTool complains that it does not see them.

Change-Id: Ib616058584f8f95229213224cec98fa6b6f7522b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-20 13:20:31 +00:00
Ivan Donchevskii
2887f5e5a9 ClangPchManager: Allow errors in pch-s
There are cases when we can't avoid errors when we put all
system includes together. This might lead to not having any
pch-s which makes the indexing useless (too slow).

Change-Id: Icdbfdf916bbd0ed9b6cd18f9c976d3d4efb0e18f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-18 13:50:13 +00:00
Marco Bubke
80cdc99737 ClangRefactoring: Move clang options to BeginInvocation
Change-Id: If4e90aa8e27b961026912bef3f0e81f972fbe0c7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-14 10:09:27 +00:00
Marco Bubke
97ec6b9ad2 ClangRefactoring: Don't update the database if something went wrong
We can get an compile error. In that case we should not update the
database. In the future we should have a mechanism to report about the
database state.

Task-number: QTCREATORBUG-21949
Change-Id: I203346d536b007171f7bf255047409431c44a85a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-12 14:02:02 +00:00
Ivan Donchevskii
7fe65851d9 Clang: Extend ClangTool and CommandLineBuilder
We now support source file and not only header files and the file path is
now automatically added to the end. This removes quite some clutter.

Change-Id: I74eabd262e6c7e5f4d523e3a3cd194bd3efe1ef3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-11 15:22:58 +00:00
Ivan Donchevskii
dd778bcb23 Clang: Use full paths in compilation database for symbol collector
We we FilePath and NativeFilePath so that compiler warns us if we mix them
up.

Change-Id: I33d7abc7e4e724dff2a9b2b9b23deea8b358ccfd
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-07 15:03:39 +00:00
Ivan Donchevskii
7d64c9e3ec Clang: Fix some issues with running indexer over Qt Creator
- fix qDebug channels on Windows
 - fix the number of perameters in the sql statement
 - fix nullptr access
 - speed up preprocessor a little bit

Change-Id: Ic9b32fbcc6b409c4064c4f522b94391cbff8654e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-07 07:45:24 +00:00
Ivan Donchevskii
4599d1ad4d Clang: Improve indexing performance on Windows
Do not use delayed template parsing (it's too slow).

Change-Id: I473c92394321920239fd90e6a37f0ce517f94e6a
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-06 12:04:19 +00:00
Marco Bubke
0082a82fc6 ClangPchManager: Merge system pch tasks
The merging of the include search paths is quite heuristic but we could
provide an option to disable pch merging so users can decide themselves.
Maybe we could give user feedback why we cannot merge but this is quite
advanced.

Task-number: QTCREATORBUG-21381
Change-Id: Iac6af0c587b631d2151f63d6d97215ed6919819f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 11:07:14 +00:00
Marco Bubke
cd868e8a7b Clang: Fix crash on exit
There were threads running but the instances they called were already
deleted. Now we delete the scheduler first which is the thread holder and
which is waiting that all threads are finished.

Task-number: QTCREATORBUG-21882
Change-Id: I2e9f4d8381d79fab9a93346cef6598ab8e8f7850
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 10:16:14 +00:00
Ivan Donchevskii
68bce815ac Clang: Ignore missing includes while indexing
Change-Id: I0319fbbbde132320c06cb8b04f7d31aed9c0e218
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-05 08:35:37 +00:00
Marco Bubke
df8653dda9 PchManager: Fix generated file handling in PchCreator
Task-number: QTCREATORBUG-21843
Change-Id: I0517b87725117b7db7db14d32b737a0a6f2b3c35
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-24 12:48:02 +00:00
Marco Bubke
693c896e5a PchManager: Use Generated Files in BuildDependencyCollector
Task-number: QTCREATORBUG-21843
Change-Id: I33c29d50943a914313a4c2e577b0210460f663d8
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-24 12:47:30 +00:00
Marco Bubke
a179030a02 ClangRefactoring: Adapt project part in the database
Extend ProjectPartArtefact and use CommandLineBuilder everywhere.

Task-number: QTCREATORBUG-21842
Change-Id: Ibc78849bc543512eccec8a558a1c3f57fec33fa2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-24 12:10:27 +00:00
Marco Bubke
dd366b68de PchManager: Split pch tasks in project and system pch tasks
Like you can see in the task numbers this patch is touching many different
areas. So I will only touch the main parts. It is using a clang action
instead of an extra process which will be enabling the handling of
generated files in PCHs. The flags from the project part are now not
anymore transformed in a command line but they are saved in the container
semantically aware so that they can later be merged. Most of this patch is
simply polishing of other patches.

Task-number: QTCREATORBUG-21346
Task-number: QTCREATORBUG-21380
Task-number: QTCREATORBUG-21382
Task-number: QTCREATORBUG-21383
Task-number: QTCREATORBUG-21693
Task-number: QTCREATORBUG-21778
Change-Id: I9b0c02d8149b554254e819448fbc61eeaa5b7494
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-21 15:27:10 +00:00
Marco Bubke
390a227df6 ClangPchManager: Introduce PchTaskQueue
With the PchTaskQueue the pipeline is almost complete.

Task-number: QTCREATORBUG-21346
Change-Id: I5f05d525db1679eb37dd1d462076c1ed42958099
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-10 17:09:31 +00:00
Marco Bubke
ce9f503691 ClangPchManager: Add UsedMacroFilter
The compiler macros are filtered in system and project macros. Not used
ones are removed. The original order of the macros is retained.

Task-number: QTCREATORBUG-21548
Change-Id: Ic9265866bde033e6a9600f9e6439b1697ab73422
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-03 12:51:25 +00:00
Orgad Shaneh
5170dd0858 Merge remote-tracking branch 'origin/4.8'
Change-Id: Ia8bf92c8effdee0e1085730cb975ff88c8ad85fc
2018-11-20 19:13:13 +02:00
Marco Bubke
64a3a130ac Clang: Add BuildDependencyCollector
IncludeCollector is renamed to BuildDependencyCollector. It is now
returning a BuildDependency instead of individual getter. The test coverage
is improved too.

Task-number: QTCREATORBUG-21379
Change-Id: Ifc2d1c40c85772cf498c21968de526f4408b6023
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-20 14:24:03 +00:00
Eike Ziller
3666e3aaeb Merge remote-tracking branch 'origin/4.8'
Conflicts:
	tests/unit/unittest/unittest.pro

Change-Id: I4f0ab05f96ee60900a3a35fad4c7331238367593
2018-11-09 13:30:40 +01:00
Marco Bubke
9b1e7e440a Clang: Add BuildDependenciesStorage
Task-number: QTCREATORBUG-21378
Change-Id: Ibcb90239d240653b21f12a7b96a7775e5b0b4319
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-08 14:34:02 +00:00
Marco Bubke
6eb620238b Clang: Refactor FilePathId
We don't need the directory id any more. It's not used widely any way.

Task-number: QTCREATORBUG-21443
Change-Id: Ia95ea4c72fe9530ac56262f61f17faca04d313ba
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-08 12:51:15 +00:00
Eike Ziller
1473bc5891 Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggermainwindow.cpp
	src/plugins/qbsprojectmanager/qbsbuildstep.cpp
	src/plugins/winrt/winrtdevicefactory.cpp
	tests/unit/unittest/gtest-creator-printing.cpp
	tests/unit/unittest/gtest-creator-printing.h
	tests/unit/unittest/unittest.pro

Change-Id: Ie9b80b87a8a4fa81baf72a2daa7919b21371c15e
2018-11-06 09:20:00 +01:00
Marco Bubke
ee2122be70 ClangPchManager: Add build dependencies to include collector
It's a first step but we have to refactor the interface later.

Task-number: QTCREATORBUG-21379
Change-Id: Idda666bcaec950203f001c993c54a926779527e0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-25 13:35:02 +00:00
Eike Ziller
95db30bd3a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggeritem.cpp
	tests/unit/unittest/unittest.pro

Change-Id: Id2e4e9c2bc87b2556d7c2845aea3fe2fa11b630b
2018-10-22 09:53:54 +02:00
Ivan Donchevskii
3c1565efcb Clang: Fix build with clang 7.0
As an addition update the header with Clang-Tidy checks.

Change-Id: Ib4a4d324e8cad95403a3e799e352205b05ed7475
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-17 05:56:51 +00:00
Marco Bubke
2c885fa3d4 Clang: Split symbol storage
We need UsedMacros and source related statements in the PCH manager too,
so we have to split that class.

Task-number: QTCREATORBUG-21289
Change-Id: Ie27d4b518b3d6d9174e93fcb243fdb55a09ddf51
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-16 08:57:00 +00:00
Orgad Shaneh
1934d584c8 Merge remote-tracking branch 'origin/4.8' into master
Change-Id: I6ecd3732a147960681c6135e8752cbd046bad65b
2018-10-12 17:21:14 +03:00
Marco Bubke
28007d9a1c ClangPchManager: Introduce UsedMacroAndSourcesCollector
It's a subset to thesymbols collecter so we try to share some code.

Change-Id: I058eee39289453e205f039b3850c1816f1d8ec1a
Task-number: QTCREATORBUG-21257
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-12 07:51:49 +00:00
Marco Bubke
391cfab5d7 Clang: Add progress bars for creating PCHs and indexing
Task-number: QTCREATORBUG-21112
Change-Id: Ie0c00a58f479a2fe7cbc7322490808509733ff0f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-08 08:20:22 +00:00
Marco Bubke
4e6d09d8e1 Clang: Reuse thread based pipeline for pch creation
The pch creation so far used signal and slots but there was no explicit
pipeline. This patch is introducing the same architecture like the
refactoring plugin. It is filtering out older project parts from the
pipeline.

Change-Id: Iaa6bd2ca1272231b97ebe1f5f7b2ce8e43bc590c
Task-number: QTCREATORBUG-21111
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-24 14:33:05 +00:00
Marco Bubke
0aced361bf Clang: Cleanup symbol indexer
Change-Id: I1a7bcc807bf222ae0d8f622bca512c47489bfb79
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-12 10:34:46 +00:00
Marco Bubke
2a30f0e5d6 Clang: Improve generated files handling
Generated files are referenced by the system collector directly to set the
unsaved files.

Change-Id: I24be3ee544b7824b8b0e518eafd409f32bd002ab
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-06 11:26:00 +00:00
Marco Bubke
7cac843343 ClangRefactoring: Remove unused code
Change-Id: I752d688039e8bb85654fd54b61a0c8a4e6677954
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-03 12:14:24 +00:00
Marco Bubke
be9537667f Use Utils::setUnionMerge
And fix some details of the implementations.

Change-Id: I8e77fee4b95658a69ef1656bb406811de091ce16
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-03 12:14:16 +00:00