Commit Graph

28 Commits

Author SHA1 Message Date
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
c52c531c3f UnitTests: Move symbolscollector data to sub directory
Change-Id: Id1a123f745a0f092aeff9589aa146feb49d31661
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-12 14:01:50 +00: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
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
a86867eb8a Clang: Introduce parallel indexing
Change-Id: I522cb18e6d24b7dbed5d5dfa3a732e5b3b5113bb
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-03 12:13:10 +00:00
Marco Bubke
6fba0be280 ClangRefactoring: Improve symbol parsing
Declarations are only indexed if their file has been changed and references
has to be indexed if the file or any included file has been changed.

Change-Id: I07c6de1379bce2462c1e0fad34d4378a3da4397b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-27 08:51:29 +00:00
Marco Bubke
39e78bd3f6 Clang: Don't index already indexed symbols
We don't index system headers any more and introduce a first step to
decrease double indexing. For that we introduces the SourcesManager which
so far tells you only if a file was already indexed for a certain time
stamp.

Change-Id: Icde54465693ca84a622764c595635cac365c0111
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-20 13:16:52 +00:00
Marco Bubke
b592339b4d Clang: Don't parse system headers
Change-Id: I6474fbe4f43daaac930ad6ba49fd9cb3145a3bbd
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-14 15:03:41 +00:00
Marco Bubke
4b0bcbdcb6 Clang: Locator filter for the symbol database
There are no symbol queries for the locator filters. The signature
generation is still not implemented but for simple cases it should work.

Change-Id: Ic6b04fbe1e7e057892f194ac139615c47d6ec33f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-12 13:12:24 +00:00
Marco Bubke
b0fd6c30ce Clang: Distinguish between Enum and Records
Creator is distinguishing enumerations and records, so we should do too.

Change-Id: I114cfd207464abd9afd96c26c7504cf8a3a1cb8c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-12 13:11:51 +00:00
Marco Bubke
de4f6301e6 Clang: Process SymbolKind and SymbolTags with the indexer
We add the infrastructure to compute the SymbolKind and SymbolTags in the
indexer. Later we have to add more for templates, virtual functions etc..

Change-Id: I9203c5cfbfffed3065337292010de5fce5736453
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-27 14:45:58 +00:00
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
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
98774d7b92 Clang: Remove export filters
Lets try to find a better way to do it later.

Change-Id: I960abf65c910f639cc860b8e1291b0c235b7db07
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 16:49:27 +00:00
Marco Bubke
048224bef1 Clang: Collect source dependencies
It is quite easy because we track the include directives in the
preprocessor callbacks.

Change-Id: I2d7bd67b31f50c0d8d4a46c57e83dffa0c558dc7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:06:09 +00:00
Marco Bubke
b2d3951bde Clang: Clear used macros and file information for symbol collection
We have to clear them too otherwise we will collect them which can lead
to wrong data in the symbol database.

Change-Id: Iad7b87344caec0f27a5f8f24c214573a274db911
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:06:00 +00:00
Marco Bubke
70ab43ca62 Clang: Get file informations from symbols collector
We need the same information like file size and the last modification time
to check if a file has changed. This information will be saved to the
database.

Change-Id: Icf8eb9b6553945a563887e11aff9539c9b300b66
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 15:03:56 +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
4f0c17bc5d Clang: Improve Macro collection
Now undefined macros are added to used macros but we filter out header
guards and dynamic libraries export. The export is quite simple but
without we would think that exports change the AST.

Change-Id: Ic16f60a6675e397dfd769c53caf77056708d8459
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-01 14:47:46 +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
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
a15250051d Clang: Handle native file in the file cache
Different types are introduced for normalized and native file path. So the
compiler is warning you if you try the wrong format.

Change-Id: I1da0686b142cbf9bb7578468c2b50f90a94cebf9
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-11-23 11:55:15 +00:00
Marco Bubke
507d99f03c UnitTests: Use memory database
Tests get more reliable if the database is not shared between different
tests and the testing is speed up by not accessing the file system.

Change-Id: Ieb3c5495df4f0fae2293111949792774b01bf913
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-23 17:59:20 +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
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
f0e00a8c25 Clang: Add symbols collector
Change-Id: I64c25eef8eaa6cc6c3ff09d41866972b6c7248d0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:09 +00:00