summaryrefslogtreecommitdiff
path: root/src/libs/3rdparty/cplusplus
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Add -fPIC also for OBJECT librariesCristian Adam2023-05-121-1/+0
| | | | | | | | | | add_qtc_library would have set the POSITION_INDEPENDENT_CODE property for STATIC libraries on UNIX based systems. The OBJECT libraries need the same treatment. Change-Id: Ia333a36ea0f35d7db3ed876cdde5b895b47644c7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CppEditor: More special rendering for string literalsChristian Kandeler2023-04-131-1/+6
| | | | | | | | | | | | | Display prefixes and suffixes different from the actual string, like we already did for raw string literals. This uncovered some minor bugs in both lexer and highlighter: - Wrong length for a setFormat() call in highlightRawStringLiteral() - Missing check for user-defined literal in raw string literals - Missing check for user-defined literal in multi-line strings Fixes: QTCREATORBUG-28869 Change-Id: I018717c50ddc1d09c609556161c85dfb0cc29fab Reviewed-by: David Schulz <david.schulz@qt.io>
* Replace a few \returns by Returnshjk2023-03-241-2/+2
| | | | | Change-Id: I09c633e610421f5cc8257b15de60ffa98d890ee0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* CPlusPlus: Add parser support for generic lambdasChristian Kandeler2023-03-136-2/+90
| | | | | | Change-Id: Id17975a4296925c10b1b43f963412eea61ccfa5d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Add support for coroutinesChristian Kandeler2023-03-0613-18/+196
| | | | | | | | | Also fix some concept-related bugs uncovered by the test case. Change-Id: Ia67c971026bcd85d9cc252f46cd4f56c2865d432 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Support requires clause in parserChristian Kandeler2023-03-0311-0/+88
| | | | | | | Change-Id: Ice6a7a287453516a1cfc296e2c9f16160b3ea130 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Handle C++20 concepts in parserChristian Kandeler2023-02-2813-1/+518
| | | | | | | Change-Id: I8c6b8b1ba3f36b83cd1d667bec9830271147b1ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Add lexer support for new C++20 keywordsChristian Kandeler2023-02-094-4/+126
| | | | | Change-Id: I2b83deb0502ebf2cdca2af774fbb2ce26e947c11 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Cpp: support space ship operator in lexerDavid Schulz2023-01-306-21/+37
| | | | | | Fixes: QTCREATORBUG-27503 Change-Id: Idbff5a9b5b2e6e841e298ca6f706ef3c6aa1622b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CMake build: Use version-less Qt targetsEike Ziller2023-01-051-1/+1
| | | | | | | | | Since we do not support Qt < 5.15 anymore, and as a first step for getting rid of our special FindQt5.cmake. Change-Id: Icc5dbaf9b0a3a622b1f609ff114b9decb6d2856c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CppEditor: More migration to FilePathhjk2022-12-142-6/+19
| | | | | Change-Id: I261b713671e00bb567f61b4ee5ecf6fa83473bff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/9.0'Eike Ziller2022-11-102-2/+24
|\ | | | | | | Change-Id: Ie069f3b2a1200b3e665341b1d56ce836024b0d29
| * QuickFix: Fix generate function definition with unsigned typeArtem Sokolovskii2022-11-102-2/+24
| | | | | | | | | | | | | | Fixes: QTCREATORBUG-28378 Change-Id: Ic94901e430d08aab22c8f4c394eda1f8a93398bc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CPlusPlus: Allow " = default" also on function implementationsChristian Kandeler2022-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | Note that we only make sure not to trip over valid code; we make no effort to check whether default/delete is actually allowed at this type of declaration. Fixes: QTCREATORBUG-28102 Change-Id: Ic693319b9dfaf8652cf4cae9cd907a6e258ad773 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CPlusPlus: Remove unused parser functionsChristian Kandeler2022-10-212-60/+0
|/ | | | | | | | | | It's unclear whether they should actually be used, but right now their presence is confusing. Change-Id: I15d8a7a2524c3abc668bcd0a4b3e0e956f68b065 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* CppEditor: Remove extra CPlusPlus::Class memberChristian Kandeler2022-09-163-10/+1
| | | | | | | | | | | | | | | | | | | Amends 0fab5956ea91dc0ee40b4d99605ec26a3720c5c8. We want to avoid carrying these eight bytes ber Class instance around. Instead, we now just replace the (anonymous) struct name with the typedef'ed one. Note that in C (but not C++), this is possible: struct S {}; typedef struct {} S; struct S s1; S s2; However, our code model has never respected the extra struct namespace, so it can already not distinguish between occurrences of "S" and "struct S". Change-Id: I55feafea7d3a4a5848e10f7011f633a2ce0f626e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Store typedefed name for anonymous structsChristian Kandeler2022-09-153-0/+13
| | | | | | | | | ... and use it as the struct display name in some places. Fixes: QTCREATORBUG-26611 Change-Id: I1b127f5705307a0fabd2441ff871162c882927a5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ClangCodeModel: Use central functions for getting token positionsChristian Kandeler2022-08-262-0/+8
| | | | | | | Change-Id: I192e2807067467906b38e164933755f763133cb4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CPlusPlus: Fix mis-parsing array-related constructsChristian Kandeler2022-08-253-20/+30
| | | | | | | | | | | ... as structured bindings. Also add a safety check to Bind that might be needed for invalid code. Amends ca00b874a7. Change-Id: I7b174b80ad97ed7424f1e369b876c99acf7e95d2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Support structured bindingsChristian Kandeler2022-08-2314-38/+175
| | | | | | | | | | While we do recommend clangd for modern code bases, we should still be able to parse basic language constructs. Fixes: QTCREATORBUG-27975 Change-Id: I189b991685a5cd5f62f2afce77878b60c895e8f9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* CppEditor: Consider selection when requesting quickfixesChristian Kandeler2022-08-232-0/+16
| | | | | | | | | | | If the user has a token selected, prefer that to the actual cursor position. Fixes: QTCREATORBUG-27886 Change-Id: Ib32e24676510bff42292fe23e4962720fcbac4ed Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* cplusplus: Disable warningMarcus Tillmanns2022-08-041-0/+4
| | | | | Change-Id: I08f3b40afc50903304627aeb788c60fcbafdd288 Reviewed-by: hjk <hjk@qt.io>
* CPlusPlus: Inline more simple Type related functionshjk2022-06-288-391/+102
| | | | | Change-Id: I2103e8047b385b438e58072e8a2689f1889d2724 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Inline some Scope related simple functionshjk2022-06-284-47/+15
| | | | | Change-Id: I23486fdfa749fe864c04d5c1a7cede21fb16005b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Use a global variable for the undefined type instancehjk2022-06-245-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and split the FullySpecifiedType in two overloads. Initially: 29 [1] FullySpecifiedType::FullySpecifiedType(Type *type) : <+ 24> 41 54 push %r12 <+ 26> 55 push %rbp 34 [1] static UndefinedType t; <+ 27> 48 8b 2d 26 68 13 00 mov 0x136826(%rip),%rbp 29 [1] FullySpecifiedType::FullySpecifiedType(Type *type) : <+ 34> 53 push %rbx <+ 35> 48 89 fb mov %rdi,%rbx 34 [1] static UndefinedType t; <+ 38> 0f b6 45 00 movzbl 0x0(%rbp),%eax <+ 42> 84 c0 test %al,%al <+ 44> 74 12 je 0x7fffc135c620 <_ZN9CPlusPlus18FullySpecifiedTypeC2EPNS_4TypeE+64> <+ 46> 4c 8b 25 5b 66 13 00 mov 0x13665b(%rip),%r12 35 [1] return &t; <+ 53> 4c 89 23 mov %r12,(%rbx) 34 [1] } <+ 56> 5b pop %rbx <+ 57> 5d pop %rbp <+ 58> 41 5c pop %r12 <+ 60> c3 ret After making it a global variable: 29 [1] FullySpecifiedType::FullySpecifiedType(Type *type) : f3 0f 1e fa endbr64 30 [1] _type(type), _flags(0) <+ 4> c7 47 08 00 00 00 00 movl $0x0,0x8(%rdi) 32 [1] if (! type) <+ 11> 48 85 f6 test %rsi,%rsi <+ 14> 74 08 je 0x7fffc14675f8 <_ZN9CPlusPlus18FullySpecifiedTypeC2EPNS_4TypeE+24> <+ 16> 48 89 37 mov %rsi,(%rdi) 34 [1] } <+ 19> c3 ret <+ 20> 0f 1f 40 00 nopl 0x0(%rax) 33 [1] _type = &UndefinedType::instance; <+ 24> 48 8b 35 49 67 13 00 mov 0x136749(%rip),%rsi # 0x7fffc159dd48 <+ 31> 48 89 37 mov %rsi,(%rdi) 34 [1] } <+ 34> c3 ret The no-parameters branch after splitting: 29 [1] FullySpecifiedType::FullySpecifiedType() : f3 0f 1e fa endbr64 30 [1] _type(&UndefinedType::instance), _flags(0) <+ 4> 48 8b 05 5d 67 13 00 mov 0x13675d(%rip),%rax # 0x7fffc159dd48 <+ 11> c7 47 08 00 00 00 00 movl $0x0,0x8(%rdi) <+ 18> 48 89 07 mov %rax,(%rdi) 31 [1] {} <+ 21> c3 ret Change-Id: I61439d68921cf9fa422304033b75de16bb4aa0d5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Inline some simple central functionshjk2022-06-2413-1000/+319
| | | | | | | | | | | | | Depending on context, callgrind sees contributions of >8% to the total cost of project parsing for these functions. The functional are actualy executed executed out-of-line, often for a function body of one "payload" instruction only. Inlining removes the call/endbr64/ret overhead. Change-Id: I6886f08e322fcaa4e0f54d424279e0a8c24e4718 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CMake: Qt Creator Static build supportCristian Adam2022-04-291-1/+6
| | | | | | | | | | | | | | | | | | | This adds the build system feature that allows Qt Creator's libraries and plugins to be compiled statically. Fixes some symbol clashes when all plugins are linked into the same executable. Support for actually loading static plugins will be added in a separate commit. The feature is controlled by QTC_STATIC_BUILD which by default is OFF. Change-Id: I1fab7953c43e42dc75619e35660029ee067106df Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CppEditor: Fix "move function definition"Christian Kandeler2022-04-051-23/+32
| | | | | | | | | | | | | | | | | | | ... for member functions with exception specification and/or reference qualifiers. The FunctionDeclaratorAST::cv_qualifier_list member can contain both the proper qualifiers "const" and "volatile" as well as the pseudo-qualifiers "override" and "final". The problem is that the former appear before exception specification and reference qualifiers, whereas the latter come afterwards. Therefore, when calculating the declarator's first and last tokens, we can't just mechanically check the different declarator members in order. Instead, we need to compare the token values to see which comes first. Task-number: QTCREATORBUG-27132 Change-Id: I924f9afe49453fa51b4a2fe010d1cc00c9defad1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Remove qmake build filesEike Ziller2022-01-201-69/+0
| | | | | | | | | | Removes qmake as a build system for building Qt Creator itself. Keep them for some tests that are not completely moved to CMake yet. Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Fix highlighting of raw string literalsChristian Kandeler2021-12-102-4/+44
| | | | | | | | | | | | ... with the built-in highlighter. Pass the necessary context information in and out of the SimpleLexer. Task-number: QTCREATORBUG-26211 Fixes: QTCREATORBUG-26425 Fixes: QTCREATORBUG-26615 Change-Id: Id72f743e07ae117ca51b0d5e527b208dda133b7e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* CPlusPlus: Allow numeric literals with single quotesChristian Kandeler2021-11-081-1/+1
| | | | | | | | | | | | ... also in macro expansions. Amends 8c437362bc. Just like in that patch, we don't prevent trailing quotes, even though they are not allowed. Unlike in that patch, we don't check the language version, as it is not set during preprocessor mode (for whatever reason). Fixes: QTCREATORBUG-26484 Change-Id: I8737724208802ed9a9005af538cf13fbfd2efd42 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Fix buildChristian Kandeler2021-10-271-0/+3
| | | | | | | Amends 05e698a478. Change-Id: Ie33c233b89cad40f7e6a29a26582990ba9029f44 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Fix "insert def from decl" for template return typesChristian Kandeler2021-10-272-0/+14
| | | | | | Fixes: QTCREATORBUG-26397 Change-Id: Ia215f2c2b5da708b0fd7c894987683b305f4ccec Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Fix "insert definition" for templates with value parametersChristian Kandeler2021-08-172-1/+5
| | | | | | Fixes: QTCREATORBUG-26113 Change-Id: I2d2a1c1bdcffd67072bbda99dabbbfbfafe115c5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge remote-tracking branch 'origin/4.15' into 5.0Eike Ziller2021-06-241-0/+9
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/cmakeprojectmanager/projecttreehelper.cpp src/plugins/coreplugin/mainwindow.cpp Change-Id: Ie3a281b8635e79ca5fa794a127ed0039f33fe2ee
| * CMake build: Force optimization of CPlusPlus libEike Ziller2021-06-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | Even in the debug build, as done for the qmake build system. This is for performance optimization of this critical part for C++ parsing even in debug / developer builds. Change-Id: I9552ba9fc44e213f2df1d2d2a64a126af3603fd1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* | CPlusPlus: Fix MSVC Debug buildCristian Adam2021-06-041-1/+9
| | | | | | | | | | | | | | | | Amends 011f62dfc255b73e9fc952fa35abbb8219856f8d Change-Id: I33aea095341ee5e1cb38763cde04b567ea030986 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* | CPlusPlus: Fix build with clang-clCristian Adam2021-06-031-3/+3
| | | | | | | | | | | | | | | | llvm-link is picky regarding missing dllimport symbols. Change-Id: I189ddaa0962ded9ebe16d60bae568979a35403a3 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Utils: Make Link a classChristian Stenger2021-05-311-1/+1
| | | | | | | | | | | | Change-Id: Ia2f1c9589f65064eca2416b093b3fecf568058d2 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* | Utils: filepathify LinkDavid Schulz2021-05-251-1/+1
|/ | | | | Change-Id: Ie62500bde139158e776f9698ee0ea00c2a113f93 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CPlusPlus: Increase maximum statement depthChristian Kandeler2021-04-201-1/+1
| | | | | | | | | | We're hitting the limit in a real-world project. (Of course, it's pretty horrific that we unconditionally access pointers that can legally be null, but that's difficult to change now.) Fixes: QTCREATORBUG-25606 Change-Id: I1d8c883550e8968bbfa6ce26965573697774361f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Lexer: Support the integer suffixes LU and LLU alsoAndre Hartmann2021-04-191-0/+4
| | | | | | | | | | Before we only supported UL and ULL. And add tests for all variants of allowed integer suffixes. Fixes: QTCREATORBUG-25604 Change-Id: Id92f371d2effa7456d2d50891a6c29810c5c4c75 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Add missing line and column info for lambda functionshjk2021-02-051-0/+1
| | | | | | Task-number: QTCREATORBUG-25242 Change-Id: I5032bb04879e30f5516471e2038dc4b6bb3477f8 Reviewed-by: hjk <hjk@qt.io>
* CppEditor: Add Base Class Support for Generate Constructor QuickFixLeander Schulten2021-02-042-0/+28
| | | | | Change-Id: Idd92229134609c0ac87aad030a6bb645ff4cce1b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Add missing includesJarek Kobus2021-01-132-0/+3
| | | | | | | Amends 675abca1caad1c295330caa5e9b42cc812caee83 Change-Id: I88d48fad84043bfea5310f8aad5d77cf550be2d9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Compile fixJarek Kobus2021-01-131-0/+1
| | | | | | | Amends 675abca1caad1c295330caa5e9b42cc812caee83 Change-Id: I958c6b43631d287e6973abb0c61a5c381766adb3 Reviewed-by: hjk <hjk@qt.io>
* Use std::unordered_map instead of std::mapJarek Kobus2021-01-137-30/+71
| | | | | | | In theory it should be faster. Change-Id: Ibf6ce8c5dced5a075b57f89ce6e2d5ed1c5d6be7 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/4.14'Eike Ziller2021-01-123-1/+21
|\ | | | | | | Change-Id: I26a53ef81a54a2f7aa482448118298895b712941
| * CPlusPlus lib: Add support for BINDABLE in Q_PROPERTYLeander Schulten2021-01-083-1/+21
| | | | | | | | | | Change-Id: I8ca00aff63261eea997267d41b12c2397d676748 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>