Commit Graph

18 Commits

Author SHA1 Message Date
Nikolai Kosjar
b8a6a4dd4e CppTools: Move WorkingCopy to new cppworkingcopy.{h,cpp}
Change-Id: I447acf28849bffb52c1e6b6eafdde221ec0b179e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-20 10:26:47 +02:00
Nikolai Kosjar
0f3032f840 CppTools: Tests: Add "Find Errors Indexing" mode
Adding QTC_FIND_ERRORS_INDEXING=1 to the run environment will Creator
force to do some "extended indexing" in order to find bugs:

   1) The project files are parsed as if they would be opened in an
      editor. That is, parsing happens as precisely as possible, based on
      the ProjectPart information.

   2) Symbols are looked up by invoking CheckSymbols, the backend of the
      semantic highlighter.

   3) A "Task List File" (*.tasks) will be written with all diagnostic
      messages.

This special indexing mode is meant for testing purposes. E.g. it can be
run nightly on some bigger projects to find regressions.

Note that Qt Creator will quit exactly after the first time some source
files are indexed. E.g. that will happen if you open a file manually or
if you open a new unconfigured project. Therefore it's required to
configure projects as needed before invoking in this indexing mode.

Change-Id: If25b83e67d24df9e28e107cb062f21cbf3b4c643
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-07 11:04:53 +02:00
Nikolai Kosjar
6a9ae7e25f CppTools: Auto-include pre-compiled headers
So far the pre-compiled headers were processed (thus defines from those
headers were visible), but the actual includes for the documents were
not added, which is necessary for lookup/completion.

Note that this will be only done if pre-compiled headers are not ignored
(Options > C++ > Code Model > [] Ignore pre-compiled headers).

Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-24 12:25:02 +02:00
Erik Verbruggen
3d33886e53 C++: fix include/framework path handling.
Instead of having two lists of paths, now only one list is used where
both include paths and framework paths can be mixed. This reflects the
way the compiler is invoked, and retains the (correct) search order.

Task-number: QTCREATORBUG-11599
Change-Id: I373953e3e305df5b7a0d10920e12d146584adf9f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-04 13:51:36 +02:00
Erik Verbruggen
13d2d499ab C++: move post-sourceprocessing action into callback.
Change-Id: Iac6c9fe1ada27ac0d96417e490cc5723e6969541
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-18 11:04:35 +02:00
Nikolai Kosjar
ec97d967e6 CppTools: Rename CppPreprocessor to CppSourceProcessor
...since it does quite a bit more than only preprocessing, as the name
suggests. We use that class to process source files in general. The
output is not a preprocessed source, but a set of CPlusPlus::Documents
with symbols.

Change-Id: I787d0f22f9f042ddf0c99e8c2f0bdb9aa7001735
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-04 16:28:35 +02:00
Erik Verbruggen
346e84d219 C++: introduce a project config file field in the projectPart.
This field is used by the generic project manager which passes the
".config" file in it. The advantage is that both the SnapshotUpdater and
the clang code model do not need to do anything smart, but can pass it
directly to the preprocessor.

Task-number: QTCREATORBUG-11390
Change-Id: I44fc7b20afd28fb59608412f2cce86af6f7e7d6b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-02-27 15:58:17 +01:00
Eike Ziller
236ea9efb9 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/dumper.cpp
	share/qtcreator/debugger/dumper_p.h
	share/qtcreator/debugger/test/main.cpp
	src/plugins/debugger/gdb/classicgdbengine.cpp
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.h
	src/plugins/debugger/lldblib/guest/main.cpp
	src/plugins/debugger/lldblib/ipcengineguest.cpp
	src/plugins/debugger/lldblib/ipcengineguest.h
	src/plugins/debugger/lldblib/ipcenginehost.cpp
	src/plugins/debugger/lldblib/ipcenginehost.h
	src/plugins/debugger/lldblib/lldbenginehost.cpp
	src/plugins/debugger/lldblib/lldboptionspage.cpp
	src/plugins/qbsprojectmanager/qbsstep.cpp
	src/plugins/qbsprojectmanager/qbsstep.h
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h
	src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp
	src/plugins/qnx/blackberrycheckdevmodestep.cpp
	src/plugins/qtsupport/debugginghelper.cpp

Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
2014-01-08 11:01:06 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Erik Verbruggen
ea1a92484a C++: split defines into project-defined and toolchain-defined.
So we can ignore possibly problematic toolchain-defines, while can still
unconditionally apply project-defines.

Change-Id: I7cb96f35a963d080011fe888ef71bfc098dd33ef
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-12-10 11:42:41 +01:00
Erik Verbruggen
566be0995d C++: Release more documents.
- fix memory leak in find-usages
- do not retain snapshot in search history
- when an editor is invisible for more than 2 minutes, release the
  backing snapshot

Retaining snapshots will retain their documents, and if done for too
long, the memory consumption might grow. This is especially the case
when switching to a different kit (Qt version): in that case, the new
versions of headers will be indexed, while the old ones stay around.

Task-number: QTCREATORBUG-5583
Task-number: QTCREATORBUG-7645
Task-number: QTCREATORBUG-9842

Change-Id: I045eda1565e0a3fa702baeffaab9c12662f90289
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-11-12 09:24:13 +01:00
Erik Verbruggen
d57b405f29 CppTools: fix inclusion of "injected" defines.
Task-number: QTCREATORBUG-10280

Change-Id: Ibc6ffeedb97a31a35a2d1f00625506f844692e16
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-23 12:52:40 +02:00
Nikolai Kosjar
e79d4ed2e1 CppEditor: Follow Symbol Under Cursor opens the preprocessor dialog
... when invoked on a macro that is defined inside that dialog.

Change-Id: I419c6675d70cfb8dd174f6a33f502b4c584baa3a
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-10-22 15:58:54 +02:00
Nikolai Kosjar
802b67ff04 CppTools: Protect SnapshotUpdater getters by mutex
Task-number: QTCREATORBUG-10282

Change-Id: Ia58359f774c72260956caecd5f63d44b612d1451
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-10-09 15:01:42 +02:00
Erik Verbruggen
7b2c26204a CppTools: add method to manually set the project part.
Change-Id: Ic3578bd98c2f1aefcaef61f5b993dc9a67ca5a77
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 14:37:08 +02:00
Erik Verbruggen
8c79d5bc23 C++: add code-model support for defines-per-editor.
The UI side will come in another commit.

Change-Id: I1038a438587fe4cef70408f7f627d08837fc192d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 13:03:47 +02:00
Erik Verbruggen
507452f097 CppTools: honor pre-compiled headers in the code-model.
Task-number: QTCREATORBUG-476

Change-Id: I82ed92acdcda551d2c6a9ca221832ac20117a08f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 13:02:45 +02:00
Erik Verbruggen
ba2d7a4fa7 C++: Only parse with appropriate defines for open editors.
If two files from different (sub-)projects include the same header file,
and the defined macros differ for both files, the header file will be
parsed with only the appropriate macros for the including file.

Task-number: QTCREATORBUG-9802
Task-number: QTCREATORBUG-1249

Change-Id: I560490afa287b3bb1e863bce1bb4f57af36ad56e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 10:33:51 +02:00