Commit Graph

34 Commits

Author SHA1 Message Date
Marco Bubke
c174eb378a Clang: Reduce database accesses
If we prefetch data from the database to the caches we reduce the database
transaction calls which are quite expensive.

Change-Id: I617a0d886807402e0a94291a913a77f989970b55
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-08-27 11:53:32 +00:00
Marco Bubke
56d611e0a3 ClangPchManager: Update PCHs if time stamps of dependencies changed
If there is a newer file than the last indexing or if a file is added or
removed from the project or system PCH we have to reindex the project and
maybe the system PCH.

Change-Id: Ibce2a244190a79b5c422c469c065ddc11e44b2cb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-08-27 11:50:39 +00:00
Marco Bubke
cdda564946 Clang: Set indexing time stamp by dependent sources
Instead of using the time stamp from clang we simply set one time stamp
for all dependent sources.

Change-Id: I0adbe59d46c88ddd1ac491a7f7db568bcf2ac540
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-08-27 11:48:54 +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
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
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
70d4e46552 Clang: Rename ProjectParts in ProjectPartsManager
Change-Id: Ia60d78e34a296b0b379339ebc14efd0e81dc8989
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-03-06 11:27:27 +00:00
Marco Bubke
f009dad9ef ClangPchManager: Show extra progress for dependency building
Task-number: QTCREATORBUG-21956
Change-Id: Id244c9ef9fc7825489daa143b21fcca78164d8c7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-22 12:09:09 +00:00
Marco Bubke
14a44948d8 ClangPchManager: Fix deferred project parts
Change-Id: Ie760c0dd269c643a147d7edf3f1b812cd27fe4c4
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 10:16:47 +00:00
Marco Bubke
4ee5d68b33 PchManager: Update only after generated files have been updated
Task-number: QTCREATORBUG-21843
Change-Id: I881e86dac4074438880d657a07f2e473489ab42d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-23 13:10:20 +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
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
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
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
b173c3d83f Clang: Add generated files support for pch manager
Change-Id: I69aae62dd1091a1958d4b0f23a37758c9f58c97b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-12 15:08:46 +00:00
Marco Bubke
0bef7610a1 ClangRefactoring: Move generated files to own messages
There must be a management about it but this will be added in a different
change set.

Change-Id: I47b6ce7f671f1c8ae07083d6d99c534069e3cc1a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-08 13:13:35 +00:00
hjk
cf4dbb4bb6 ClangSupport: Use simpler structures in some cases
The patch is mostly mechanical, but contains also a few spurious changes
from values references for some local variables, foreach -> ranged for
etc that I coulnd't resist.

Change-Id: I58f0bd972546895eb318607cbfbd7ac35caf3f23
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-06 12:55:23 +00:00
Marco Bubke
53454b0f79 Clang: Use PCHs for indexing
As generating the AST is quite expensive it would be very useful to cache
the not changed include. So we generate PCHs for include outside of a
project part. With this change this PCHs are used by the indexer.

For that they are save to the symbol database by the PCH manager and when
fetched by the symbol indexer.

Change-Id: I7a5b07cfb32d72d50dc52d2b108cd41727a7bfc7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-22 13:26:24 +00:00
Marco Bubke
1f0562742e Clang: Add lastModified to the precompiled header
It is important to know then the PCH generation started, so we can compare
the header file time stamps against it.

Change-Id: Id8ee91e886c153d9d4a37cc0438c682f2098f7fa
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-20 14:04:00 +00:00
Marco Bubke
6922f549d5 Clang: Check if the include search path has changed
If the include search paths and the compiler macros have not changed it is
save to assume that we don't need to update the symbol database. This saves
us from executing a very expensive task. Later we have to test the
modification time of the files too.

Change-Id: I6b958075024a811c2abd3d7918263fd74bba090b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 10:23:39 +00:00
Marco Bubke
56f79feebf Clang: Introduce CompilerMacro
We want not only the name but the value of the macro too. So we can
compare if anything has changed.

Change-Id: Ie59caf8cbf54d108f9e15299d25306a406b5c40d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-15 09:58:53 +00:00
Marco Bubke
22b5bbbff3 Clang: Add defineName to ProjectPart
We need them later to find out if the defines have changes.

Change-Id: Iaaa14df3dc6f50cb286c2dac37db13c975063c1e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:54:49 +00:00
Marco Bubke
0f8befacd3 Clang: On the road to update and preprocessor support
This patch has grown in a quite big change set and it is really hard to
divide it in different parts.
V2::ProjectPartContainer is now using FileIds instead of file paths. This
cleans code up because it is a big step in the direction that internally
only file ids are used. But it is depending on the file cache, so the
file cache has to be provided as an argument. There is now an interface for
transactions too which are ease the testing of them and enables the support
of preprocessor. It adds macros as symbols and is saving used macros. The
used macro support is enabling update improvements because only if a
changed macro is used it needs to be recompiled. This is still in flux
and can be changed in later patches.

Change-Id: I492a2c9af1201d40fdd9f46a0045f7878bbbaa3d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-29 13:47:09 +00:00
Marco Bubke
d2e15e5f1e Clang: Add file cache
The database is using file path integer ids to handle file paths because
otherwise we would save many redundant data. This patch is improving it
further with the introduction of a database based file path cache. The
entries are now divided in a directory path and file name. This is quite
handy for directory based file watching.

Change-Id: I03f2e388e43f3d521d6bf8e39dfb95eb2309dc73
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-05 17:36:37 +00:00
Marco Bubke
f49a1d721c Clang: Add symbol storage
Extend file path cache to 64 bit integer.

Change-Id: I5627f13d59a3214f389087038482cbcc8d0eb484
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:24 +00:00
Marco Bubke
8f93ec3020 Clang: Use PathString in more cases
Change-Id: I7bee469256a79b384bf7b8c1d5355f1df11c7b24
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-02 12:46:51 +00:00
Marco Bubke
b860d46579 Clang: Handle generated files
We don't handled generated files so we got internal parse errors.

Change-Id: If75e202f93fe3f71f43e3b1d15c0fb77e20c2248
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-01 13:11:15 +00:00
Marco Bubke
ea4141ee14 Clang: Add Process Generator
So far we only compiled the precompiled headers only sequentially. The
process generator is creating, managing a queue of processes to compile
the PCHs parallel.

Change-Id: I8075def4ef9e6b0191bbd51b3631d1c51ec7b361
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-31 14:18:38 +00:00
Marco Bubke
c072cdfb88 Clang: Add ClangPchManager
Compiling every header file again and again is quite time comsuming. There
are technics to improve this like preambles(a kind of automated
precompiled header) but they don't share their data between translation
units. This approach provides an automatically generated precompiled
header for every project and subproject to improve the loading time.

Change-Id: I34f5bd4db21951175920e2a9bbf6b97b1d705969
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-30 13:55:58 +00:00