Commit Graph

13 Commits

Author SHA1 Message Date
Marco Bubke
b6e12f4a1c Convert macros from plain QByteArray to a vector of structs
The old code model expected the macros as C++ formatted text
("#define Foo 42) but newer targets like the Clang codemodel expect key
value arguments like "-DFoo=42". So instead of parsing the text again and
again we use an abstract data description.

Task-number: QTCREATORBUG-17915
Change-Id: I0179fd13c48a581e91ee79bba9d42d501c26f19f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-14 15:23:56 +00:00
Nikolai Kosjar
8a076e3f4b CppTools: De-duplicate and rename function in ProjectPart
Change-Id: I675ce4c9059d8ae4046f6a13aa7c04b88141d443
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 14:35:29 +00:00
Tobias Hunger
cee92463f7 ProjectPart: Allow for line/column information in project file
Keep this information separate so that plugins using the information
do not need to start parsing the project file.

Change-Id: Ibecf431de1b12bbe820c6f8f9c986cffeb4972d2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-03-09 13:49:36 +00:00
Nikolai Kosjar
7381736cf3 CppTools: Clean up ProjectPart
Change-Id: Ia7969ceb52ffb25e7c63b24bc33b091001e9b50a
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 08:33:14 +00:00
Nikolai Kosjar
a10bfb8400 CppTools: Do not hardcode default language version
...instead, use the latest we support.

Change-Id: I7e7768bc4bc31de1fe0f441c03f3ab5d677d76e8
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 08:33:09 +00:00
Francois Ferrand
38ae5aec10 C++: Fix handling of Objective-C/C++
- Objective C/C++ was not enabled in highlighter.
- QMake project part for Objective C/C++ did not have ObjectiveC extension enabled.
- As languageFeatures.objCEnabled is a bitfield, it was actually always set to 0.
- Highlight ObjC class & protocol declarations.
- Highlight ObjC message passing.

Change-Id: I64d12c9509058d05f7adce94598cb7ce91727ac8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-12-05 10:27:58 +00:00
Nikolai Kosjar
b0a49ca1c1 Clang: Fix parsing MSVC's crtdefs.h for 64 Bit
...by specifying the word width, as for the Clang Static Analyzer.

This has gone unnoticed so far because it looks like that the error diagnostic
from the bug report can be extracted with libclang (as shown in the info bar),
but is not printed from libclang or clang.exe itself.

Task-number: QTCREATORBUG-17130
Change-Id: Ia7a5ee3825c7211cdf80c2166a9eb454ce48cac1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-10-18 15:03:52 +00:00
Francois Ferrand
7b2c09a118 C++: Disable C++ keywords in C files
In some (legacy) C files, new and delete may be used for regular identifier.

There are some limitations:
* Header files have no 'implicit' type, and may be parsed as C++ or ObjC depending on the
other files in the project.
* QMakeProject use a single ProjectPart for C and C++ files, so there will still be the issue.

Change-Id: Iec11687b35f7ccf1e7c0d091b143ae90d950e440
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-08-23 12:35:04 +00:00
Nikolai Kosjar
4e0b55f673 Clang: Undefine language features as fix for MSVC2015/clang-3.8.0
This applies the following change for the clang code model, too.

  commit d13d179524
  Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0 II

Change-Id: Ia229d7e8b24c2e1c0a83d9a53c623ea1f79c4a06
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-12 14:54:06 +00:00
Marco Bubke
e42bf6ebc6 CppTools: Remove all references to the tool chain in the project part
Change-Id: I5fd55eadf94c8a185c2082b93b27bf4432e5cabf
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-01 13:13:32 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Marco Bubke
da1f8e66e5 CppTools: Move ProjectInfo in its own header file
Change-Id: I0fc4c73553a29585d4ff7c8d6593acb6975d1607
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-13 14:47:04 +00:00
Marco Bubke
2b4cadf1fe CppTools: Move ProjectPart in its own header file
Also extracting inline HeaderPath class and change projects list in vector
because the size is  larger than a pointer.

Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-13 14:46:56 +00:00