Commit Graph

14 Commits

Author SHA1 Message Date
Christian Kandeler
ed292f3f9b clangbackend: Categorize non-const pointer arguments as output arguments
Fixes: QTCREATORBUG-24550
Change-Id: Iac4f3b133a632d7272bfe4253f8a0740e51b0952
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-21 08:08:29 +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
Ivan Donchevskii
ca24877c93 Clang: Improve anonymous cursors support
With the recent libclang fix the anonymous cursors
are reported properly. So we can use that information
instead of some of our workarounds.

Change-Id: I94401f33e671e6dd08ac7d850c8d5c3dbdd062cc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-18 09:09:58 +00:00
Nikolai Kosjar
d52ac9a708 Clang: Fix unresolved #includes for ui_*.h headers
...with an extra parse.

Previously, the creation of an e.g. "Qt Widgets Application" from the
wizard could show code model errors in mainwindow.cpp. Depending on
timing issues, the first error is either

  1. 'ui_mainwindow.h' file not found (QTCREATORBUG-15187)
    The parse happened before the in-memory ui_mainwindow.h was
    generated by uic. The file system watcher can't help here as the
    #include was not resolved successfully. And libclang's reparse does
    not handle this case (it would need to remember all failed #include
    stats...).
    ==> Detect this case with the help of the include paths and trigger
    a full parse.

  2. or: allocation of incomplete type... (QTCREATORBUG-15187)
    The parse happened after the generation of the in-memory
    ui_mainwindow.h, but before the clangbackend received the unsaved
    file.
    ==> Fix this by also writing the content of the unsaved file to our
    behind-the-scenes-created ui_mainwindow.h.

Fixes: QTCREATORBUG-15187
Fixes: QTCREATORBUG-17002
Change-Id: I4f3a81adaa3d604746977a402c29f83fbc5b0e44
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-31 10:38:27 +00:00
Ivan Donchevskii
d05fe2fe15 Clang: Re-enable tests which do not fail anymore
Change-Id: I1f8f396eeb8e97a8910bc2bd454227a395330f31
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-10-25 10:25:01 +00:00
Nikolai Kosjar
aa290912b8 Clang: Remove project tracking on clangbackend side
...as it is not needed. Just provide the compilation arguments as part
of the Document.

As a side effect, re-initializing the backend after a crash is cheaper
and will not freeze the UI anymore (referenced bug).

Task-number: QTCREATORBUG-21097
Change-Id: I866e25ef1fd5e4d318df16612a7564469e6baa11
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-26 10:45:41 +00:00
Ivan Donchevskii
bdd5066665 Clang: introduce more data in TokenInfo
Data added:
- return type spelling for functions
- parent spelling
- access specifier for class fields and methods
- storage class

New highlighting types are added, therefore
types are now categorized by class, struct, etc.

Change-Id: I1739b94a6f777045fde655060d8b9a12b6e0889b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-02 07:01:28 +00:00
Marco Bubke
5ab729ea10 Clang: Fix tests for output arguments
Change-Id: I9aeef5758c6291f19efc3d72d5d985adad4c13ab
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-07-27 14:04:32 +00:00
Marco Bubke
ae485ac551 Clang: Return ClangString instead of Utf8String
Utf8String is allocating memory but for many compares it is not needed.
In an inner loop this can be expensive.

Change-Id: I6320823ab7e086008447eea255e52859a7faaad7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-06-14 14:04:49 +00:00
Ivan Donchevskii
78db7d7ed2 Clang: turn off delayed template parsing
Fix templates highlight and completion on Windows
Add UI to turn on/off delayed parsing (off by default)

Task-number: QTCREATORBUG-17222
Change-Id: I0cd5e0bcfff2789cd938e4096829f777ff15957a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-06-08 10:53:31 +00:00
Nikolai Kosjar
186368c202 UnitTests: Disable known to fail tests for Windows
So we can easily verify if other changes break anything.

The disabled tests should be all related to the by default enabled delayed
template instantiation on Windows, which is necessary to parse windows headers.

The disabled tests can be run with --gtest_also_run_disabled_tests or by
setting the env variable GTEST_ALSO_RUN_DISABLED_TESTS=1.

Change-Id: I040d881ff0a3fbf5fe85c0b3d1b8e7b0959d1b9c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-20 16:29:58 +00:00
Marco Bubke
63ae993bf2 Clang: Add output argument highlighting
This adds a mix-in for writable functions arguments.

Change-Id: I758f7fef77d992ea25395db550571ccb081fd5fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-10-12 08:01:48 +00:00
Nikolai Kosjar
1a426d9f01 Clang: Support second translation unit
A TranslationUnit is owned by TranslationUnits now. TranslationUnits
allows to add another TranslationUnit and to update/query the recently
and previously parsed translation unit.

This does not change any behavior yet.

Change-Id: I8a2f0cc05d3e51bf739dd5d7c4da14b54147f3ab
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-10 12:35:48 +00:00
Marco Bubke
47c01daeb2 UnitTest: Cleanup
Improve naming and introduce googletest.h.

Change-Id: I445c13db4c23d6dd5682ce0db3b83055cc6b8a89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-19 15:17:54 +00:00