Commit Graph

24608 Commits

Author SHA1 Message Date
Leandro Melo
d6ccffc06c C++: Core changes in preprocessing
Summary of most relevant items:

- Preprocessor output format change. No more gen true/false. Instead
  a more intuitive and natural expansion (like from a real compiler) is
  performed directly corresponding to the macro invocation. Notice that
  information about the generated tokens is not lost, because it's now
  embedded in the expansion section header (in terms of lines and columns
  as explained in the code). In addition the location on where the macro
  expansion happens is also documented for future use.

- Fix line control directives and associated token line numbers.
  This was not detected in tests cases because some of them were
  actually wrong: Within expansions the line information was being
  considered as originally computed in the macro definition, while
  the desired and expected for Creator's reporting mechanism (just
  like regular compilers) is the line from the expanded version
  of the tokens.

- Do not allow for eager expansion. This was previously being done
  inside define directives. However, it's not allowed and might
  lead to incorrect results, since the argument substitution should
  only happen upon the macro invocation (and following nested ones).
  At least GCC and clang are consistent with that. See test case
  tst_Preprocessor:dont_eagerly_expand for a detailed explanation.

- Revive the 'expanded' token flag. This is used to mark every token
  that originates from a macro expansion. Notice, however, that
  expanded tokens are not necessarily generated tokens (although
  every generated token is a expanded token). Expanded tokens that
  are not generated are those which are still considered by our
  code model features, since they are visible on the editor. The
  translation unit is smart enough to calculate line/column position
  for such tokens based on the information from the expansion section
  header.

- How expansions are tracked has also changed. Now, we simply add
  two surrounding marker tokens to each "top-level" expansion
  sequence. There is an enumeration that control expansion states.
  Also, no "previous" token is kept around.

- Preprocessor client methods suffered a change in signature so
  they now receive the line number of the action in question as
  a paramater. Previously such line could be retrieved by the client
  implementation by accessing the environment line. However, this
  is not reliable because we try to avoid synchronization of the
  output/environment lines in order to avoid unnecessary output,
  while expanding macros or handling preprocessor directives.

- Although macros are not expanded during define directives (as
  mentioned above) the preprocessor client is now "notified"
  when it sees a macro. This is to allow usage tracking.

- Other small stuff.

This is all in one patch because the fixes are a consequence
of the change in preprocessing control.

Change-Id: I8f4c6e6366f37756ec65d0a93b79f72a3ac4ed50
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-06-25 15:49:27 +02:00
Orgad Shaneh
e99c139352 qbs project: Add RC file for app
Task-number: QTCREATORBUG-7224

Change-Id: I146dc2251b14b3a126093f7ecf29049c8c04750a
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-25 12:10:40 +02:00
Orgad Shaneh
7204863c13 Fix qbs build
Change-Id: Ib484836705c30cb90ee52e87867e2bfde6358d64
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-25 12:10:17 +02:00
Thiago Macieira
1d90cc2ecd Fix building the Android plugin in C++11 mode again.
I had fixed this in e638dc8232 but the
changes were reversed in 2431456216.

C++11 requires a space for concatenation of string literals.

Change-Id: Iba34319953c003469ec89d2c99973bd07a124390
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-25 11:35:22 +02:00
Francois Ferrand
2cd334f96e [BaseVCS] Add splitter in submit editor.
Splitter between 'description' section and 'files' section. This makes it easier
to work with smaller screens.

Change-Id: Ie1d8c7a671faba270e6906504b3af56ff8c85e28
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-25 10:53:58 +02:00
Orgad Shaneh
5585df4d7c Qt4PM: Correct shadow build support test
Change-Id: I376a05791f1a5e8e153e2266f81bfc85c73b9535
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-25 10:36:08 +02:00
Tyler Mandry
ccd2168219 Android: Clean/speed up some code.
Change-Id: I122bc317a32f938c57f79e93f65170de26f13202
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-25 10:35:41 +02:00
Orgad Shaneh
bd95043c4b Git: Reorder fields in submit panel
Change-Id: Icd624ce174d9265fe551b9af4089b3660abc4142
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-25 10:28:01 +02:00
Orgad Shaneh
dc251deccf Project: Fix crashes
Task-number: QTCREATORBUG-7563

Change-Id: Ib7630e9ca82a0b09703ff948af95af53ced05730
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-25 10:23:32 +02:00
Tyler Mandry
f930db7e0a QmlDebug: Fix crash when remote setup fails
Change-Id: Ia9b6e86b74425ed2c5bc113f918f1d64d88c328c
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-06-25 10:14:07 +02:00
BogDan Vatra
bb0573a8aa Fix Android plugin.
Change-Id: I56533be94fc868d04bd1d289ff9d3c381391d41b
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-23 11:53:33 +02:00
Eike Ziller
a1d4afad67 Target options: Clearer naming for qt mkspec setting.
Change-Id: Ia9b5838d83afad828d7926f9db5c30e3ac021877
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-23 00:48:22 +02:00
Eike Ziller
d8d5efcd40 Target options layout fixes.
* smaller icon button (waste less space)
* align manage/choose buttons

Change-Id: Idb2cb111a40353f2405cd964c2ec4f5cf8b24d78
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-23 00:48:02 +02:00
Orgad Shaneh
6473d7b611 Fix build
Change-Id: Id4182c9cd96b74c0ffa2e1aefe9074f66e17fe92
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-21 21:19:20 +02:00
Christian Kandeler
554ef76b2e Fix qbs build.
Was broken by e3c354d8f2.

Change-Id: Icd57d7a623245b41f388b6b2edb9ebcf94df37b9
Reviewed-by: Yuchen Deng <loaden@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-21 16:15:51 +02:00
Yuchen Deng
5252fa4567 qbs files: Enable 'Help' plugin for Qt5
Change-Id: Ib8c7692984eae2d4b9e865837f4ef6970524a87f
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-21 14:16:24 +02:00
Francois Ferrand
4cac96447d Allow specifying line number when selecting a file with the locator.
When using the file selections locators (OpenDocumentsFilter, FileSystemFilter,
and those inherited from BaseFileFilter), allow specifying the line where to open
the file: like 'file.cpp:654'.

This syntax works for wildcards/incomplete expression as well: toto:423 will match
'toto', and open resulting file at line 423.

Also, fix line extraction in editormanager, to support a single semicolon (without
number) as well as a line explicitely set to 0.

Change-Id: I80e13b59aa9c972f33963cfee81ec04f277fe526
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-06-21 13:03:56 +02:00
Tobias Hunger
69552f01d4 Fix build on windows
Change-Id: I89bfbefe189ed68c3da0330900015917aff29976
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:11:45 +02:00
Tobias Hunger
260b2c9d1d Fix crash in cmake plugin
Change-Id: I90fa6386e98c7b089c5b1192f3657629a1da2112
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:11:37 +02:00
Fawzi Mohamed
bfb0dfafd0 librarydetailscontroller: bugfix mac
Change-Id: Icac245a09fc2d8a9486bdf8e247a399957b5ff97
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-21 12:11:22 +02:00
Tobias Hunger
bb793093ed Fix reading of existing .user files
Update factories for this to work as well as the settingsaccessor.

Change-Id: If7cb1db3fa0c50441aa5bd1c2d2659c6a0177743
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:11:05 +02:00
Tobias Hunger
a14b9daf1b QtVersionManager: Simplify the code
by removing legacy upgrade code that should no longer be used anyway.
Remove the count of versions while at it.

Change-Id: I014a8934581761d3219fe41dc7888903e7d6a85c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:10:55 +02:00
Tobias Hunger
50e78e0cce Remove useless virtual keywords
Change-Id: I893a3c69d6f796b5b77f2ce3e2c76dd437d3a8c8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:10:40 +02:00
Tobias Hunger
5ea6c2a607 Make clear that the RemoteLinuxRC Id is actually a prefix
Change-Id: Ie877c563fd80d96db0527dfcfbdfbff6762409cf
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:10:27 +02:00
Tobias Hunger
329e0e584e Fix maemo toolchain handling
Upgrade Maemo toolchains to normal gcc ones.

Change-Id: I30b1ec42b42de728efa81ef2e54d75d0e4afd565
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:10:17 +02:00
Tobias Hunger
d35e3aa0fa ToolChain: Extract more information from map data
... of a stored tool chain. This is necessary to upgrade toolchains
to 2.6 file format smoothly.

Change-Id: I401a18924360fdf2d2797bebd9a0dcc059e80518
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:09:53 +02:00
Tobias Hunger
7315f6cddd Target: Simplify code a bit and fix a possible qWarning
Change-Id: Idb4f7a39221fd3147d3e1ff1001b327532870c08
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:09:41 +02:00
Tobias Hunger
0d9e4b7405 QMakeProfileInformation: Report mkspec in a better way
Report teh effective, default and set mkspec separately to improve
the importing and the UI.

Change-Id: I6087950cd961829d7fcf60b3f6de317a02444631
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:09:23 +02:00
Tobias Hunger
0a6e31d831 Devicemanger: Improve error reporting
Improve error reporting when loading a device failed.

Change-Id: I6fdb8b77db10d03651d087aff9417a31ecdb0fdb
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:09:11 +02:00
Tobias Hunger
783c53fbd2 Device: Simplify code a bit
Simplify the code a bit, now that Core::Id uses utf8 conversion from/to
QString. Also make sure to not trigger warnings on invalid data.

Change-Id: Iccc523161fbcb89148a76684353e96ac875c24c7
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:09:00 +02:00
Tobias Hunger
420fd035ab Remove some useless lines
Change-Id: Ib64fa3f0ba1b020077440d14390872bedfae76e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:08:39 +02:00
Tobias Hunger
88d2efcbeb Whitespace Changes
Change-Id: I5cafe8a659090d7e6f7afeeac0c103f98085bda3
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:08:21 +02:00
Tobias Hunger
2431456216 Profile introduction
Introduce Profiles to store sets of values that describe a system/device.

These profiles are held by a target, getting rid of much of the information
stored in the Build-/Run-/DeployConfigurations, greatly simplifying those.

This is a squash of the wip/profile branch which has been on gerrit for a
while, rebased to current master.

Change-Id: I25956c8dd4d1962b2134bfaa8a8076ae3909460f
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-21 12:08:12 +02:00
Orgad Shaneh
8c77b8c9d7 Git: Support file names with spaces
Change-Id: I19fa6fbcbf480b4a6c31cf628f8ca392f7bd7ef2
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-06-20 22:23:10 +02:00
Tobias Hunger
a65520f92a Ignore SDK directory
Ignore the directory used by the SDK to store Qt versions, etc.

Change-Id: Ieb4021ac5fdf607996256aed55437b552c9c1794
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-20 22:21:02 +02:00
hjk
af8abd0a9d debugger: .note.gnu.build-id is not a safe marker for debug builds
Change-Id: I4f380aeee9458a114d904ea396310c5a71295036
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-20 16:15:17 +02:00
Leandro Melo
93894ab160 C++: Do not reuse content in completion if it's unfinished identifier
Taskn-number: QTCREATORBUG-7521

Change-Id: I7b8edb93d143f599c93a82c82bf2c0d49c8e49e9
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-06-20 16:08:23 +02:00
hjk
3e0d666f70 debugger: improve performance of output pane
Change-Id: I5417c3bb36ba399b5687f9aa51ba17a973a32a40
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-20 15:57:24 +02:00
Leena Miettinen
0495649c75 Doc: todo entries output pane
Change-Id: I3ab06225d9effae24d77046febd6b6b798b03f3e
Reviewed-by: Dmitry Savchenko <dmitry.a.sav@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-06-20 15:54:33 +02:00
Eike Ziller
6e2db0b66e Merge remote-tracking branch 'origin/2.5' 2012-06-20 14:52:30 +02:00
Robert Loehning
79ca1f3d7c Squish: Fixed missing suffixes in getEditorForFileSuffix
Change-Id: Iabda661a70a7656003b47aaf91de28c213d076dc
Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
2012-06-20 12:41:03 +02:00
Jan Kerekes
f22449b94a Squish: Added new test cases(4, 5) to c support suite
initial commit

Change-Id: If2fb169ac66ccbcc463e4cfef491ca4fb3e01c30
Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
2012-06-19 17:32:39 +02:00
Eike Ziller
e3c354d8f2 Make PluginManager mostly static.
Change-Id: Ib938aa4999c7c418a82304c5cca2e8748ef9d228
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-19 16:11:40 +02:00
Leandro Melo
9daa34003d Revert "C++: Re-enable macro definition line test"
This reverts commit 44d8e7bef7.

The original test case was actually right. I guess I was mislead
by the recently added preprocessor tests, which are the ones
that should be corrected (together with the preprocessor, which
seems to have issues with # lineno generation).

Conflicts:

	tests/auto/cplusplus/preprocessor/tst_preprocessor.cpp

Change-Id: I47f82ed23a37086d0d81c4b3ea2cac48fb753451
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Francois Ferrand <thetypz@gmail.com>
2012-06-19 12:47:52 +02:00
Leandro Melo
f978400ae5 C++: Better handling of arg count mismatch in macros
Do not expand function-like macros at all when there's a mismatch
in the parameter/argument count.

The report below raises the issue but its expected result is not
correct. This would be the more appropriate fix.

Task-number: QTCREATORBUG-7225
Change-Id: Ide8580faa7b724d3e8b396ec1f899cc5ca7f9e7e
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-19 12:47:44 +02:00
Marc Mutz
7eaaab6e73 Add spaces between macros and string literals
Commit fa66a540 fixed string literal and macro concatenation
some time ago, but while it changed "literal1"M1"literal2" to
"literal1" M1 "literal2" it didn't touch M"literal". This patch
changes this to M "literal" for consistency.

This patch is the remnant of a cherry-pick of a C++11 compilation
fix equivalent to fa66a540 from KDAB's branch of QtC 2.4.0.

Change-Id: I87644e888a7e74b18d4b1ca10786cdc3fa798453
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-19 12:47:27 +02:00
hjk
7853297f77 runconfig: consolidate createConfigurationWidget implementations
Most derived classes used essentially identical 'return 0;'
implementations. Use a base class implementation doing that instead.

Change-Id: I99727ac2230a5d9f168b4b0eb5927f8efff44e64
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-06-19 12:46:23 +02:00
Christian Kandeler
b2f6c7223d SSH: Replace assertion by exception.
We used Q_ASSERT to verify packet validity even for incoming packets,
which means a malicious host could crash QtCreator by sending invalid
data.

Change-Id: Ie2b674d40273d987d91387f41748fbe085c63ed8
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-19 12:46:07 +02:00
Yuchen Deng
0d20c5b796 Fix qbs code style
Change-Id: Ia3e4df528d391580064efbeeab75016335a4299d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 11:22:40 +02:00
Yuchen Deng
0527a8bb70 Fix qbs build with Qt5 (part2)
Change-Id: Iaadded4e1dc557f8e2e0a70b89b44bdda200faef
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 11:18:06 +02:00