Commit Graph

192 Commits

Author SHA1 Message Date
hjk
52b2ca55c9 Replace QT_USE_FAST_{OPERATOR_PLUS,CONCATENTION} by QT_USE_QSTRINGBUILDER
QT_USE_FAST_CONCATENATION doesn't do anything nowadays.

Using QT_USE_QSTRINGBUILDER is the same as QT_USE_FAST_OPERATOR_PLUS
for QStrings and enables more QStringBuilder use for QByteArrays.

Change-Id: Ibd297817c50d86661d47822799f989447249af1b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-08-07 12:45:03 +00:00
Eike Ziller
d400dce35d Require GCC 7 and enable C++17
Fix MSVC2019
- result type of conditional expression is ambiguous:
  types 'const char [1]' and 'QByteArray' can be converted
  to multiple common types

Fix MinGW 8.1
- undefined reference to SemanticHighlightNotification::methodName

Fix Utils::transform with std::vector for GCC & MSVC

Unfortunately we cannot get rid of the special variant and optional
implementations, because Apple Clang requires deployment target >= 10.14
for the functions that can throw std::bad_optional_access.

Fixes: QTCREATORBUG-20520
Change-Id: I5c36a70f21f8b0215d2f4fc5c0653a022778d928
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-07-10 11:52:24 +00:00
Marco Bubke
1e6807c680 QmlDesigner: Add listmodeleditor
Task-number: QDS-2294
Change-Id: I66cae3a0d4265ab112eaf6b04e3a5972d185ff43
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 10:28:07 +00:00
Marco Bubke
32e181f5ce ClangRefactoring: Remove not used pch files
Because we use UUID for pch files every time we rebuild a pch we get
a new file. This patch is collecting and removing this pch files.

Change-Id: Ia8688e7215ee7b41f39b2285323eaa345056bda3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:50 +00:00
Marco Bubke
c924a45fb2 Refactoring: Fix unit tests
One if the LLVM 10 hot fixes was not working.

Change-Id: I1e6cab39ffd5c52f55fb83ff777f6eca457dea35
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:42 +00:00
Marco Bubke
36b72e2bab QmlDesigner: Break dependencies
To get the model under unit tests we have to break every depenedency to
code outside of the unit test scope.

Change-Id: Ib613c3308e48990c55b2ed0cd42bc4b0e1041a01
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:34 +00:00
Marco Bubke
50d3067bcd UnitTests: Refactor printing
Move standard printing functions to extra header.

Change-Id: Ib032047235297dfe3ac0bcdbd39c353493f3ae0d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-10 13:34:37 +00:00
Marco Bubke
06866c3ee9 Sqlite: Use a more efficient update hook
Change-Id: Ic6df1f4ba6b914c7751faf7cf89083fa50a92793
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-09 14:48:27 +00:00
Marco Bubke
a61eff0079 Sqlite: Add session support
Session are captured by hooking in the sqlite changes. They are saved in
blobs and containing inserts, update and deletes. Because the are
semantically coupled to translactions we add a

Change-Id: Ie095558ebc50601fcaae32958ebeeb98b72d73b9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-05 09:52:42 +00:00
Marco Bubke
a4b00a7742 Sqlite: Add update hook and use it to get the last changed id
Sqlite has a function to get the last inserted rowid but very often you
want to get the updated rowid too.

Change-Id: Ie276a5039682813ad16597433996a2959f54d9ba
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-12 13:05:57 +00:00
Marco Bubke
0e1870368c Sqlite: Add Sqlite::Value
It adds a layer if you don't know if the type is integer, float or string.
It does not handle bytearrays here because so far there is no need. There
are two classes, Sqlite::Value and Sqlite::ValueView. Value owns the
string, ValueView holds only a view the string. So there is no allocation.
It is designed to hold Utf-8 string like Sqlite but it can be easily
converted in and from QString or QVariant but mind about that this is not
free. ValueView has no constructors on perpose because it would be
ambiguous if there would be constructors for the other primitives of
the Sqlite layer like "int64", "double" and "string view".

Change-Id: Ia39364eb2fc1998e5c59fdb4316add22c748507d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-04-27 18:17:11 +00:00
Eike Ziller
5c121d5791 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp

Change-Id: Ib54f1645ec70a9e6460a888a13190ede130bccca
2020-02-05 11:59:35 +01:00
Christian Stenger
93896c9832 Unit: Fix building without ClangRefactoring
Change-Id: Id2a4d9d030c4a36eebc88f93029d846f08870eac
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-02-04 06:43:22 +00:00
Cristian Adam
3890473500 CMake Build: Fix unittests
Change-Id: I4282f2f80b1d8d1d902ac8252b8a826ca0e459c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-03 13:57:51 +00:00
Nikolai Kosjar
e6d16b6747 ClangTools: Support loading exported diagnostics
Add a new toolbar button to load diagnostics exported with

   $ clang-tidy -export-fixes=/path/to/file
   $ clazy-standalone -export-fixes=/path/to/file (master version)

Change-Id: I8316fe0706a18222e68220ef4fbfdc7ae8d09804
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-09-03 09:39:48 +00:00
Eike Ziller
f689f86be5 Merge remote-tracking branch 'origin/4.10'
Change-Id: I1193e94353c14492a9e7f093fbcd3fa53f83e390
2019-07-18 07:30:29 +02:00
Marco Bubke
ec3c7946af UnitTests: Fix compile without Clang
I moved the clang depend code under the condition that it is only compiled
if LLVM is present.

Change-Id: If1e37f677464ff38833c81dbebdfe8eaa563cdde
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-16 08:19:06 +00:00
Tim Jenssen
333b33edbe Merge remote-tracking branch 'origin/4.10'
Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
2019-07-12 15:53:56 +02:00
Christian Stenger
49525c578c Unify disabling build of llvm related plugins or test on Windows
If libclang's build mode mismatches the current build mode
of Qt Creator some plugins are automatically disabled.
Do the same for the unittest and unify the way to do this.

Change-Id: Ib4cd6494ed63cb89ed8d99b3c0ba23a19572fc9b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-07-05 12:46:27 +00:00
Tim Jenssen
1df6443d4a Merge remote-tracking branch 'origin/4.10'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/libs/utils/synchronousprocess.cpp
	src/plugins/baremetal/iarewtoolchain.cpp
	src/plugins/cmakeprojectmanager/cmakeproject.cpp
	tests/unit/unittest/CMakeLists.txt

Change-Id: I124ad492df403286751e175d27fe36487ddf6d07
2019-07-04 15:17:55 +02:00
Marco Bubke
376aae2711 Clang: Remove old code
We maybe bring back the clang query interface but the local rename is
better served by other plugins.

Change-Id: I97bedcb20870632b7dd50977794a65b2b09ededb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-07-04 08:41:10 +00:00
Eike Ziller
10098b2508 Merge remote-tracking branch 'origin/4.10'
Conflicts:
	CMakeLists.txt
	tests/unit/unittest/unittest.pro

Change-Id: I64296ad31502d9b35012da129a28e9277e9fcf8e
2019-06-28 12:50:03 +02:00
Marco Bubke
bbd58ca30b Clang: Watch directories instead of files
Because there a limited resources to watch files we watch now directories.
So we need much less resources.

Change-Id: Iac558832e9521a7a1a67c5ea99b42ad1b0b5129c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-27 12:31:52 +00:00
Christian Stenger
64e842759b Unittest: Silence most of the warnings on Windows
There are lots of warnings coming from including
or linking against LLVM which cannot be influenced
directly. Silence most of the warnings to be able
to work with the mess.

Change-Id: I2c4adec14945ada878bb1e6fda2f06e6d56007e2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-06-25 07:36:47 +00:00
Marco Bubke
4bae5de36b Enable macro editing for the Clang indexer
Refactor much of the code from Environment* classes to NameValue* classes
to share it with the preprocessor macro settings.

Change-Id: Ica4ee817aa338230c422b30d91240d266248d226
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-06-13 16:51:48 +00:00
Marco Bubke
3bd653416a Clang: Add global preincludes search path
Some header like windows.h adds dangerous defines which are not used but
break the indexing like "small". We now preinclude them and undefine the
dangerous the defines. This can be used for speed up the indexing as we
could provide stripped headers.

Change-Id: I2a89a4719ada7591e0e7a1ecc411b2e0ffd40d9a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:25 +00:00
Ivan Donchevskii
9d4c7b1c42 Unit-test: Fix build
Change-Id: Id89bbd391117d998bb6e8d4607786ac48580a7f4
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-04-18 14:29:07 +00:00
Marco Bubke
dce3e9708c UnitTests: Allow cast from char* to QString
Otherwise it is not working for older compilers and Qt versions. We can
revert it if we drop support for that old versions.

Change-Id: I0f71e05235e9ff24cee28131654c9b6df9997643
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-04 10:48:23 +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
Nikolai Kosjar
56584b1dde Clang: Fix unit test build without QTC_ENABLE_CLANG_LIBTOOLING
Change-Id: Ifa6588d1427489e8ae98ea8093d5d94049c270ee
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-20 13:20:56 +00:00
Ivan Donchevskii
d3ceb9ce62 Unit-tests: Fix the debug build with MSVC
Change-Id: I99fd6db6406b088cab0538b07cd20ca1427a5f71
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-19 15:22:04 +00:00
Ivan Donchevskii
d7058e1afe ClangFormat: Refactor indenter to allow ClangFormat unit-tests
We do not build texteditor files in unit-tests so some tricks
were required to make ClangFormatIndenter available.

First simple unit-test proofs it builds and runs.

Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-22 09:52:15 +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
ef8de6a384 CppTools: Introduce HeaderPathFilter
We went the filtering of the header path outside of the compiler options
builder so merge the PCHs.

Task-number: QTCREATORBUG-21693
Change-Id: Ia1126813a5049e39d7c6e7d60bf449aa17012d02
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-17 11:06:14 +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
96eb407266 ClangPchManager: Introduce PchTasksMerger
So far no merging is happening but we will add it after the rest of the
pipeline is in shape.

Task-number: QTCREATORBUG-21381
Change-Id: I610c243eabcb305843ad6339fdc636b0c3966fc1
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-10 17:09:02 +00:00
Marco Bubke
299a163b18 ClangPchManager: Extend PchTaskGenerator
It's generating now PchTasks for project and system includes and call the
merger directly.

Change-Id: I966a9a72e1b915255d95b713b66e92d36d85d79b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-10 10:58:40 +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
Eike Ziller
29c9f8080d Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/android/androidrunnerworker.cpp

Change-Id: Ibd8b99435365fb7e7d488313fd1d2b3a75adad1b
2018-11-29 13:36:14 +01:00
Marco Bubke
30b522892c UnitTests: Fix build
Change-Id: I9527c97ef2a7360df7b347dc779989c6f6a9710b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-22 13:41:14 +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
f644ea0a01 ClangPchManager: Add BuildDependenciesProvider
It is still unfinished but I want to add other changes first.

Change-Id: Ife7ac56576f85d800633ea1e8f1c3f4f16486d5f
Task-number: QTCREATORBUG-21377
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-06 11:52:11 +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
Ivan Donchevskii
f604c8a77c CompilationDatabase: Support both code models
Extract headers, defines and fileKind from flags in
order to have complete project parts.

Side-effect: better support for MSVC-specific flags.
Change-Id: Iaa1413c91c96c3cf89ddbe76a7a1f0f46c5289c0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-01 14:52:05 +00:00
Marco Bubke
f8ec57919f ClangPchManager: Add PchTaskGenerator
Task-number: QTCREATORBUG-21358
Change-Id: Ia460ce82c3c896f4d0ac00638d03800a55dd27dc
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-25 13:35:11 +00:00
Marco Bubke
be3e06cc7e Clang: Fix test
Change-Id: I599d42f3a2584b40cbcec1368db9a2b11b0112d5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-25 13:34:44 +00:00
Christian Stenger
1b231d1dc6 Tests: Fix linking without lib tooling
Change-Id: I51110089b1bed337de54dfa7167b2a5aff761837
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-24 15:30:51 +00:00