Commit Graph

5028 Commits

Author SHA1 Message Date
Marco Bubke
438b5736d5 UnitTests: fix spelling
Change-Id: Ib6a94c0fac5fe6ead62a440dbe8c6368cfd7dd57
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-12 14:38:51 +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
ee85cf4518 Clang: Store the symbol kind in the database
It is cleaning up some other stuff too.

Change-Id: I75274356fd35f2ee8c84aedf8839c67506ab2355
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-12 13:12:08 +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
Ivan Donchevskii
f9d95c9205 Clang: Optimize clang overview model
Build the tree in only one loop.

clangbackend generates tokens almost as fast as it
did before (about 10% slower in general).
Broken documents are more affected and take much more
time (about 300%) but it's better to have this time spent
on backend side then in QtC itself.

Task-number: QTCREATORBUG-20205
Change-Id: I34c58bca30c4494005a029abd82c7e612ecd6fb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-12 09:15:12 +00:00
Ivan Donchevskii
84b983617f Clang: Support anonymous types in tokens
Add extra data to Keyword tokens.
Does not affect highlighting.

Change-Id: I206499ea35ee4ece5fe442665c904090cf5d90fc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-12 06:51:07 +00:00
Orgad Shaneh
7caa09c71c UnitTest: Fix signedness incompat. warning
Detected by GCC8.

Change-Id: Id45f8d7928d2071ce7ad59ce0c09e9baa9cbf32c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-11 10:43:31 +00:00
hjk
99bcc00199 ExtensionSystem: Remove PluginManager::getObjectByClassName
Not used anymore inside Qt Creator.

If 3rd party code really relies on this function, it can use the
function locally, or, likely switch to the still supported
getObjectByName or getObject.

Change-Id: I041877b3e0630e6b257055dec5e10baf68c83546
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-11 06:47:18 +00:00
Marco Bubke
42ecd2ed3d Clang: Fix reset for write and execute in the sqlite statement
We were not reset a statement if we got an exception. There are now test
for it.

Change-Id: Ife7b4437fece9369767605ba7387bd0564c1bb8d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-09 13:09:55 +00:00
Marco Bubke
9d7225d283 Clang: Cleanup transaction statements in the database
Change-Id: I795248492fe952c230fd3a9cf8bf16f3c831f161
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-09 13:09:45 +00:00
Marco Bubke
4335dc7ff8 Clang: More tests for symbol indexing
Change-Id: Ic0806fbf245c9b69f74eaa8e3d52cad90dafedbf
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-09 13:09:33 +00:00
Marco Bubke
d4ef90e632 Clang: Filter duplicate locations
An unique index is prevent double locations in the database.

Change-Id: I167cafe1a707dd8a8a9754b8d69790a8382f4eea
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-09 13:09:28 +00:00
Oswald Buddenhagen
bb027e10a8 fix llvm libdir handling wrt RPATH, more or less properly
we must not add the llvm libdir if it's a system path. this was already
done in some places, but not in others.

while we're at it, re-shuffle some pre-existing conditionals to make
things consistent.

Task-number: QTCREATORBUG-20178
Change-Id: Ib7e5a81705494e4cf2f83a4782ecd0832b91e511
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-09 12:54:53 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
Orgad Shaneh
5e483d04bc Clang: Fix build
This amends commit cf4dbb4bb6.

Change-Id: Ib74fba38348a02f6bb9d254b7a5e9013a2013942
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-09 05:25:40 +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 Benelli
a874cf581d Qml/js reformatter: use quotes in objects literals
The reformatter used to remove the quotes that wraps the property name
in object literals.  This causes problem when the name is not a
valid identifier, resulting in that valid code become invalid after
reformatting.
This patch forces wrapping of property's name in quotes: in this way,
the reformatted code is consistent and it never get invalidated.

However the resulting formatted code is not consisted with the one
formatted by previous versions.

Task-number: QTCREATORBUG-17455
Change-Id: I1e361102819055de210d6c81020f204c08aaa253
Reviewed-by: Markus Maier <markus.maier.sw@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-05 06:50:03 +00:00
Marco Bubke
28da1261c8 Sqlite: Use compiled statements for transactions
So we don't recompile them again and again.

Change-Id: I54c95e9d81df86f4944b9e3d45a7277f93f37312
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:36:44 +00:00
Marco Bubke
23865a102d Clang: Handle constraint exceptions in the file path storage
It can be happen that the entry is written by an other connection after
we tried to read and before we write. This would lead to a double entry
which be prevented by the unique index in the database. In that case we
simply try again and read the id from the database.

Change-Id: I6c9d94e95ae11556bb446813f64be0855be4ddbe
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:35:37 +00:00
Marco Bubke
c5f9765c93 Clang: Handle all busy states in the file storage
It can be happen if different connections try to write and read at the
same time.

Change-Id: I30e9120fdb8f6963f5440eed48e2cfdf8803b2be
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:35:29 +00:00
Marco Bubke
5870905db6 Clang: Handle a busy database in the PCH plugin
This can be always happen for write statements. It fixes the wrong behavior
of the transaction that it tried to rollback if begin fails. If begin fails
the transaction never started so there is nothing to rollback.

Change-Id: I8a03162257fa22a0bb66ccb844f90c6afbc7db64
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:35:06 +00:00
Marco Bubke
789379a8e3 Clang: Fix includes in the PCH creator
We now distinguish between the the top external headers which are used for
the PCH and all external includes which are used for watching. Adding
indirect external includes can lead to errors because some are not
protected by a header guard.

Change-Id: I01576fcf1ad25e7a6e3efc252eabbd23d5c0e727
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:34:59 +00:00
Marco Bubke
410a2b95c4 Clang: Make more indices unique
This is providing more security that there will be no double entries in
the database. Instead you will get an exception if you try to corrupt the
database.

Change-Id: I162dc8ddd270b86afdf12ba4d55686637b2c09ef
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:34:39 +00:00
Marco Bubke
b6cb22899c Utils: Improve SmallString
The small string control block moved to the beginning, so it is more cache
local. The control block is cleanup too, so it should be easier to read.
The alignment is removed because it is creating to big holes.

Change-Id: I401aeb9d55455cbaa5e722dd8192e54b525ddc40
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-04 13:34:20 +00:00
Robert Loehning
12398a4abe Squish: Remove duplicate code
Change-Id: Ic852f3438fac9cdc38b53509daaa592ac0688648
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-04 13:33:12 +00:00
Robert Loehning
1aed2b06de Squish: Stabilize tst_CSUP04
Change-Id: I2e036e401253f1f2cfe29efdbeedf9a51491d0ef
Task-number: QTCREATORBUG-20140
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-04 13:27:00 +00:00
Marco Benelli
b9d72a5737 qmljs: remove remaining references to QtQuick1
This patch removes all references to QtQuick1 in qml library,
plugin, designer, profiler and tests.

Change-Id: Ie286fad96060299caae3ef328330597cf53e90d3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-03 14:40:30 +00:00
Marco Bubke
ff1ce3a475 Clang: Honor directories for the file name
The file name id must be unique for very entry, so the directory id must be
incorporated too. Now there is always one unique integer id for every
file path. The directory id is there to access and compare the directory
much faster but not provide any data to the uniqueness of the id.

Change-Id: I0f9a2ca70bc9dda0ce32ebc45eb7b082821eb909
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-28 14:01:12 +00:00
Eike Ziller
5cc24f9ac1 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/projectexplorer/msvctoolchain.cpp

Change-Id: If2116aa2dbfdb9d07088595e791f8fa706b39e00
2018-03-28 10:01:44 +02: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
Ivan Donchevskii
c93e2815c7 AutoTests: Fix build after ClangStaticAnalyzer plugin rename
Change-Id: Ic34633f98e6c3c1b73389802429f3011e87b301e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-03-27 12:33:31 +00:00
Ivan Donchevskii
3fa8db13e9 ClangStaticAnalyzer: Rename plugin to ClangTools
ClangStaticAnalyzer is only one of the tools that
we can use and it will stay inside ClangTools plugin.

Change-Id: I74278e3fd12b792ab127d352db05d856c964968c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-03-26 06:18:12 +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
hjk
401d6862b5 Debugger: Make CharArrays dumper test pass on linux
I need the #include <wchar.h> after a recent upgrade.

Change-Id: I59790d6c92b14f42df8b5ece7227c406f2810c8b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-03-22 13:05:38 +00:00
hjk
a8a23110bf Debugger: Fix enum dumper
Make the hex display work with LLDB, fix GDB and LLDB test.

Change-Id: I529b5cdc908dbcba7270bc4574fa59a012fcacad
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-22 08:45:57 +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
Eike Ziller
7ba225cb79 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: Ifd9524b0155067faf9d8a90858cc5f7da6b651bf
2018-03-19 13:13:31 +01:00
Joerg Bornemann
cabbeb1c54 Synchronize autotest defines in qmake and qbs build
Do not remove QT_USE_FAST_OPERATOR_PLUS and QT_USE_FAST_CONCATENATION
in QtcAutotest, but in the two tests that won't build with it.

In the qmake build the defines are not removed from json.pro, because
this file does not include qttest.pri.

Change-Id: I97d173528ca2a02bac1bfae30709a959e6b69375
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-19 11:50:38 +00:00
Eike Ziller
cb84ae1a21 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
	src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/gettingstartedwelcomepage.cpp

Change-Id: I126823f5f60613509520c07f52be7bc9d4f4367c
2018-03-16 09:28:08 +01:00
Robert Loehning
fad75a3d56 Squish: Update tst_rename_file
Creator only selects the filename now, the
extension will be left unchanged by default.

Task-number: QTCREATORBUG-20057
Change-Id: I66bbbb5b95e1d487c2087efa596a87a240721e44
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-15 14:09:50 +00:00
Tobias Hunger
3ef6f35cf6 PointerAlgorithm: Fix take and takeDefault
Fix take unit tests to actually test the correct template instance,
add more unit tests for takeDefault.

Change-Id: I51f5b17b6478a8c1388a91840edfb9c702697b28
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-15 14:04:10 +00:00
Robert Loehning
24db24734d Squish: Open example from Qt 5.6 in tst_qml_editor
Change-Id: Ibd5bd516d8409fa5389da3e330d6723ba772f135
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-15 11:19:35 +00:00
Christian Stenger
1f3a106025 Tests: Fix Qbs build
Change-Id: I5bc5ec98994ce83137ac1599682251db35e26663
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-03-15 07:44:49 +00:00
Oswald Buddenhagen
60245e55d7 qmake: Change source identifier type in ProString
The strings remember in which file they were created/assigned.

However, this used a non-counting reference to a ProFile, which could
become dangling. If a subsequent ProFile re-used the exact same address,
a string's source would be mis-identified, which would be fatal in
conjunction with discard_from().

Since we actually need only a unique id for comparison, let's use an
integer for that.

comment on cherry-pick: this is actually a lot more than a cherry-pick,
because the file ids need to be aware of the dual VFS which was
concurrently introduced on the qtc side.

Started-by: Simon Hausmann <simon.hausmann@qt.io>
Change-Id: I395153afaf7c835d0119690ee7f4b915e6f90d4a
(cherry picked from qtbase/190aa94be7f5e146bef44862b974d733755cec85)
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-14 15:34:01 +00:00
Robert Loehning
139d64615e Squish: Revert workarounds for fixed bug
This reverts commits 47355608db
and 6cc61be23b.

Task-number: QTCREATORBUG-19717
Change-Id: I052ff84ab33a5c483c11b66eaf55a175cc34c28d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-14 10:47:03 +00:00
Robert Loehning
38326b1811 Squish: Skip tst_opencreator_qbs
Change-Id: I0935a52f5b58c444bd6dd66cc9d93301444f0157
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-14 10:46:42 +00:00
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00
Christian Stenger
f1985df55d Tests: Fix compile for older compiler / Qt
Change-Id: I96e48c446ebd397c75dc0b47f9aaef1717b5e5af
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-03-13 07:43:32 +00:00
Tobias Hunger
0bc100911d Utils: Add pointeralgorithm.h
Change-Id: I3e81bdbf22808efbe1fb5fab13bef24c8f73f404
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-12 14:14:10 +00:00
Tobias Hunger
831b84a6fd Utils: Add take
Add a new algorithmn to take the first match in a container out of the container.

It takes a pointer to something and will try to match against a smart pointer
stored in the container. Besides that it also accepts the usual like a predicate,
member variable or member function.

Change-Id: I4aabd4d43aa076a534da6488d0f9c3695ba79c09
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-12 14:14:01 +00:00