Commit Graph

71 Commits

Author SHA1 Message Date
Marco Bubke
a6f47e872f Clang: Add isInPrecompiledHeader to the file status table
It will useful to find out if we have to wait for an updated precompiled
header.

Change-Id: I6a314f278485965571cc6e46982bbd6f5523c581
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-22 10:24:31 +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
0172631b48 Clang: Don't reparse if the macros haven't changed
We have to extend that to include paths too, which will be happen in a
follow up patch.

Change-Id: I7f8ac663ae8588e647fc6a6b5d689a629a28ef65
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-21 14:17:19 +00:00
Marco Bubke
b5c3d5a40d Clang: Improve ProjectPartArtefact
Empty strings were only handled by accident and wrongly formatted ones
were never handled. Now we do nothing for empty strings and throw an
exception from wrongly formatted strings. The exceptions are very helpful
in the test code because the show errors the the testing data.

Change-Id: I87d1678eda7502fdc3f74f51fad491803d28582b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-21 14:17:09 +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
29a4419c07 Clang: Update symbol database if file has changed
The code in the symbol indexer is quite similar, but still different
enough to prevent easy reuse of the function.

Change-Id: I47907d90066da922eafe8ff3cce124ea47ea4a0a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-14 15:06:58 +00:00
Marco Bubke
c4220041a6 Clang: Rename FileInformation in FileStatus
It's more near to the Unix convention and it has a plural too.

Change-Id: I53f85911d8fcbaadba9947c70e9a375dc6995ed5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 16:49:43 +00:00
Marco Bubke
497900eb3f Clang: Handle source dependencies in symbol indexer
Get the source dependencies from the collector and save them in the
symbol storage.

Change-Id: Ibc141970a100625398c1526f5bc644cc14d25c0c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:06:20 +00:00
Marco Bubke
5dd24110f5 Clang: SymbolIndexer is saving the file information to the symbol storage
Change-Id: Id34ce9901c1a938e7ea14da444a9ef1b052286e5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:05:10 +00:00
Marco Bubke
c0b771f99c Clang: Add macro names the to project part
So we can compare later if the macro names have changed.

Change-Id: I65c5f76e07fced8df6cc7282c03430adffcf5fa8
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:57:44 +00:00
Marco Bubke
8b85b095b2 Clang: Rename defineName in macroName
Change-Id: Iaf8da991032e5ed4726384c051290a77887351fa
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:57:34 +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
8a280129ff Clang: Update or insert used defines in the storage by the symbol indexer
Change-Id: Id8af85976be391e17886c9947863b81d206bb575
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:49:44 +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
2c08ddcd5a Clang: Add path notifier to symbol indexer
Change-Id: I2a605a5a5ac2511566edd9c069e84b5ec9d95279
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-10 12:38:47 +00:00
Marco Bubke
e94d88c172 Clang: Cleanup symbol indexer test
Change-Id: I1cfa70d092d27949e0cf9466b190afbc40c1a591
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-10 12:38:39 +00:00
Marco Bubke
ab60cfd3a4 Clang: Clear SymbolCollector before updating new project parts
Change-Id: I82e9bb4f66a7597bb911fbc97d6022ff3fdb0b35
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-03 14:45:17 +00:00
Marco Bubke
3c43e5d7ec Clang: Collect source files
Change-Id: If0183cafd00ed7e42bacbdb72a1d65624dc03cee
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-03 14:45:04 +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
3adb71d45e Clang: Add Symbol Indexing
It is a first step and now a database is generated if you start QtCreator.
Some code is now shared with the PchManager which can be improved in the
future.

Change-Id: Ic267fe7960f6c455d91832859a673ce98f269aa2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-14 13:39:55 +00:00
Marco Bubke
81d43b8a11 Clang: Add symbol indexer
Change-Id: I8ff879631ae022bc870431628be002903360369c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:17 +00:00