Commit Graph

26 Commits

Author SHA1 Message Date
Jarek Kobus
eaba657d90 Fix warnings about possible detach of temporary objects
Calling first() or last() on temporary container may
unnecessarily detach the container. Fix it by calling
constFirst() and constLast().

Change-Id: I2460efd5dbee1534eec8a514d9bff2a947bfddf9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-16 22:11:46 +00:00
Orgad Shaneh
b7d35fee82 Clang: Fix MSVC warning
C4273: 'OutputDebugStringW': inconsistent dll linkage

Change-Id: Iee29998801f2cbc821acdfdfa919e74709e3383b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-11 13:42:06 +00:00
Cristian Adam
2e63d2c7d3 Fix build of clangrefactoring backend on Windows
Broke in ccab835455

Change-Id: Ic5db7597cb6cc3c798987997d8fe50c4d801ec8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-23 12:19:20 +00:00
Cristian Adam
ccab835455 Debugging: Enable Windows debugging for clang tools
On Windows the debugging of clang tools is not working due to the
nature of how processes are started.

This makes it possible to use DebugViewer or DebugViewPP

Change-Id: I2c1e4bb7a8fafd6f07570e5d2ba4df5b44e9d44d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-09-19 10:43:12 +00:00
Cristian Adam
5738d40030 Clang Backend: enable Windows debug logging
On Windows the debug messages are not sent to the Windows logger, because a
custom Qt message handler was set up.

This commit forwards the messages also to the default message handler.

Change-Id: I1745a86f72fcc1e48cd52603633fca2f23c8fedf
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-04-01 11:22:54 +00:00
Nikolai Kosjar
5719e7961e Clang: Set LC_NUMERIC to "C" for clangbackend
The tidy check SuspiciousMissingCommaCheck uses the locale dependent
stod() when reading settings and might throw std::invalid_argument for a
locale different than "C".

Fixes: QTCREATORBUG-21605
Change-Id: I69bf719a8fd94e13ce67b46238f536c85ab2eaa3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-08 09:30:22 +00:00
Nikolai Kosjar
a4cf0ad109 Clang: Disable printing stack traces by default
Printing the stack strace in the event of a crash is very useful, but in
the worst case it can also result in a deadlock, without any trace being
printed, rendering the clangbackend completely useless.

For example, if a thread allocates memory (lock) and another thread
crashes right then, clang's stack trace printer is invoked, which
(unfortunately) also tries to allocate memory (deadlock). This was
observed with QTCREATORBUG-21559.

The stack trace printer should be fixed in clang. Until then, disable
printing stack traces by default and allow to enable when explicitly
requested (QTC_CLANG_ENABLE_STACKTRACES=1).

Task-number: QTCREATORBUG-21559
Change-Id: I418cea7f3d70bc8a9cae333b3858228650307c6e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-11-26 09:49:25 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Nikolai Kosjar
fdd695c35c Clang: Disable crash recovery in libclang
...because

 1. We already run in a separate process.
 2. It's not entirely clear in which state we end up after a crash,
    except for:
 3. A "crashed" translation unit won't be freed, even when calling
    clang_disposeTranslationUnit().

This avoids undefined behavior within clangbackend and accumulated
leaking memory in the long run. On the other side, crashes within
libclang will crash clangbackend now, too.

Change-Id: I0789c52db08ace2f7e181e3b7bdfc9f595f75e8d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-06-05 08:17:47 +00:00
Ivan Donchevskii
2c7823c975 Clang: forward clangbackend QDebug messages to stdout
...to see them in both qtcreator application output
and DebugView.
clangbackend is a separate process which provides
QtCreator stdout and stderr channels so we need to
have QDebug messages there in order to receive them.

Change-Id: I2edc4de1ca203b061395b0b3070e4471348eaad7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-01-25 14:12:34 +00:00
Nikolai Kosjar
8ced936e79 Clang: Enable QTC_ASSERT() output
We had all debug output disabled by default, even the one generated from
QTC_ASSERT and friends.

Change-Id: Ie41eac49c2c3da25f584e43d7c9a292715b3f355
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-05 15:27:07 +00:00
Marco Bubke
f70bf3d2d1 Clang: Move QLocalServer in ConnectionClient
Before the QLocalServer was in the ConnectionServer so more than one
client could connect to the server. But we never used that possibility
which made the hand shaking much more difficult. It is now moved
in the client, so that there is always a QLocalServer.

Change-Id: Ifa357074b0c0809434c49d23b1cee38496f72f43
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-28 15:08:58 +00:00
Nikolai Kosjar
e1921741af Clang: Use CrashHandler for clangbackend
Change-Id: Ic51e9c3227744fa087ade4bde9a7b5f421024f6f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-01 10:11:08 +00:00
Marco Bubke
4cdb5bab15 Clang: Add clang refactoring
Change-Id: I2e3f36f810276da3f8dc7dcc587b06f8edb586d3
GPush-Base: d02f51b48fc752fddcdef6dcb32b3f7f6c0195a3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-04 14:37:19 +00:00
Marco Bubke
2c698dff86 Clang: Make ConnectionServer adaptable
The server and client are adaptable by template parameter.

Change-Id: Ia28e2863ca73b633689964ea1df6df08f8358ac1
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-12 09:08:47 +00:00
Marco Bubke
d027cab44e Clang: Rename Ipc* in ClangCodeModel*
We want to share more functionality of the IPC mechanism and for what we
need more interface classes. But we use this names already for the
ClangCodeModel implementation. So we rename the them to ClangCodeModel*.

Change-Id: Ie320e0d3b993586a9bcc6a5aa0d32427af41202e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-06-30 09:28:56 +00:00
Marco Bubke
974070d2c8 Clang: Use MessageEnvelop instead of QVariant
QVariant has unwanted dependencies so we provided our own simpler solution.
We want to support move only types and calling the copy constructor as you
move the value in and outside. This copying is adding unwanted overhead
too.

Change-Id: I2e27a7924868efe81e8b8ff3415499c9fa22c2bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-08 14:11:44 +00:00
Eike Ziller
5952165cf9 Merge remote-tracking branch 'origin/3.6'
Change-Id: Ic4d3d94feaaa588c6244509bb3dd14c5cb646fe7
2016-02-01 16:15:48 +01:00
Friedemann Kleint
f38d291339 ClangBackEnd: Use QCommandLineParser.
Output a proper usage message instead of a cryptic "wrong argument
count" when launching it from the shell for testing.

Change-Id: Iedb6b1062c9d246a514aefb05220942e4a6341df
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-02-01 12:29:07 +00:00
Tobias Hunger
1b4321279f Update License according to agreement with Free Qt Foundation
* Update files in src/share* and src/tools

Change-Id: I78aa5d4a1d76212964e467de7676c1fcb2b777d6
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:48:57 +00:00
Marco Bubke
a2988a2800 Clang: Enable stack traces
Change-Id: Ia7b8b7aa598f74e2c80e27f328ac5ddb410c043e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-23 11:25:08 +00:00
Marco Bubke
8745c0a261 Clang: Activate clang crash recovery
Change-Id: I382a4d433ef64dedfeb39034df93579e7eb2580c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-23 11:25:00 +00:00
Nikolai Kosjar
f1300df6b3 Strip BOM from files
Change-Id: I9167c016760fe1e8378cdf84144c4bed5cd4e57c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-10-01 10:51:10 +00:00
Marco Bubke
ec4d002857 Clang: Rename command in message
Change-Id: I1e2671d15b0db3c670b86dd0d4bed5ee09e866f1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-25 12:54:27 +00:00
Nikolai Kosjar
7d81d2a00d Clang: Disable debug logging categories
...apparently they are enabled by default.

Change-Id: I6bda380655050c62e124de451a8aefd440cf4b91
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-30 08:17:54 +00:00
Marco Bubke
1402c067b1 Clang: Rename CodeModelBackEnd in ClangBackEnd
Change-Id: I13e8a458634110456375956d4d4da7239c86957f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-06-16 13:29:27 +00:00