aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Symbol.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CppEditor: More migration to FilePathhjk2022-12-141-5/+13
| | | | | Change-Id: I261b713671e00bb567f61b4ee5ecf6fa83473bff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Inline some simple central functionshjk2022-06-241-157/+0
| | | | | | | | | | | | | 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>
* Utils: filepathify LinkDavid Schulz2021-05-251-1/+1
| | | | | Change-Id: Ie62500bde139158e776f9698ee0ea00c2a113f93 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Some clang-tidy -use-modernize-nullptrhjk2019-08-011-40/+40
| | | | | Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Standardize on int for line and column valueshjk2019-07-261-9/+9
| | | | | | | | | | | | | | | Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CPlusPlus: Add toLink method to the SymbolIvan Donchevskii2018-02-071-0/+17
| | | | | | | | Basically move it from CppTools to CPlusPlus to be able to use it there. Change-Id: I0af80f93bdc029824397ceafdf940cb86c4382b0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: Fix accessing invalid file id of SymbolNikolai Kosjar2016-04-181-2/+2
| | | | | | | | | | | Symbol::_fileId can be null if the Symbol was created with a null translation unit. That is the case for temporary symbols created for lookup purposes (CreateBindings has a _control with no translation unit and thus creates symbols with no fileId). Task-number: QTCREATORBUG-15967 Change-Id: Iee518b39ba3b636fe1658e74179db3aad054d6f2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: Revert lookup to 3.4.2Nikolai Kosjar2015-11-191-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...which was least buggy. The bugs fixed by the changes we revert here (highlighting/completion for code involving templates) were minor compared to ones we currently have. Those bugs will be addressed by the clang code model anyway. Relevant commits were collected via: $ cd ${QTC}/src/libs/cplusplus $ git log \ --no-merges \ --format=oneline \ v3.4.2..HEAD \ -- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \ ../../plugins/cpptools/cppcompletion_test.cpp From this list the following were skipped due to irrelevance: 88c5b47e535d91f3db99882d5b50b263b46f223c # CppTools: Minor cleanup in completion tests e5255a1f5cac284c4f0d4a85203878c84da86e85 # CppTools: Add a test for ObjC not replacing dot with arrow 5b12c8d63a30e281274cdc267efabead2c736bd8 # CppTools: Support ObjC in member access operator tests 9fef4fb9ca4e65e20ff13b98bcf15e3c6232fdfb # CPlusPlus: Fix warnings about overriding visit(...) methods There were only minor conflicts while reverting those. This changes touches so many files because there were quite some cleanups and renames after the 3.4.2 release. Task-number: QTCREATORBUG-14889 Task-number: QTCREATORBUG-15211 Task-number: QTCREATORBUG-15213 Task-number: QTCREATORBUG-15257 Task-number: QTCREATORBUG-15264 Task-number: QTCREATORBUG-15291 Task-number: QTCREATORBUG-15329 Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* C++: Ignore explicit template instantiationsOrgad Shaneh2015-06-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Defined in section 14.7.2 of the standard. Fixes completion for std::string. The following explicit instantiation appears in bits/basic_string.tcc: extern template class basic_string<char>; This is wrongfully considered a specialization for a forward declaration (like `template<> class basic_string<char>` is). Introduce a new Symbol type for explicit instantiations. Use-case: template<class T> struct Foo { T bar; }; template class Foo<int>; void func() { Foo<int> foo; foo.bar; // bar not highlighted } Change-Id: I9e35c8c32f6b78fc87b4f4f1fc903b42cfbd2c2b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: TranslationUnit::getPosition takes utf16char offsetsNikolai Kosjar2014-05-231-1/+1
| | | | | | | | | ...and not byte offsets anymore. This is necessary in order to calculate the line and column numbers correctly with respect to unicode code points. Change-Id: I5d79857b3eaefeb8d563b4f1e3938a64debc5e08 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Clarify units of a TokenNikolai Kosjar2014-05-151-1/+1
| | | | | | | | | | | | | This will avoid confusion when later more length and indices methods are added. In Token: length() --> bytes() begin() --> bytesBegin() end() --> bytesEnd() Change-Id: I244c69b022e239ee762b4114559e707f93ff344f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Use getter functions of TokenNikolai Kosjar2014-05-151-2/+2
| | | | | | | They are already inlined. Now it's easier to find read-only accesses. Change-Id: I9aaeca3bc5860e3a20a536a2484925e4334c005f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix names of functions dealing with enclosing scopesNikolai Kosjar2013-07-161-20/+15
| | | | | | | | | | | | ...in order to better tell apart the type related functions isScope()/asScope() and the functions dealing with enclosing scopes: * scope() --> enclosingScope() * setScope() --> setEnclosingScope() * resetScope() --> resetEnclosingScope() Change-Id: Id743a7d1b6a1a1a0ffcd8568cbd8ebbdfc16eaa1 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* C++: Use soft asserts instead of assert()Nikolai Kosjar2013-05-131-2/+4
| | | | | | | Some qmake versions ignore "DEFINES += NDEBUG" on Windows. Change-Id: Ibdf3b1036c2331dcef61dcd278463c02754044d2 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: fix cloning of templatesPrzemyslaw Gorszkowski2013-04-171-1/+6
| | | | | | | | | Fix instantiation of templates(by cloning original symbols). Assigning of scope for cloned symbol is taken from the symbol which is used to instantiate. Task-number: QTCREATORBUG-9098 Change-Id: I066cc8b5f69333fabdaf2d4466b205baf08bd3f1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Fix code completion for nested classesPrzemyslaw Gorszkowski2012-12-201-1/+1
| | | | | | | | | | Fix code completion for nested classes when enclosing is template class. Unit tests Task-number: QTCREATORBUG-8245 (only standalone) Change-Id: Ib31ad4b799db927b56debd4dc3e7403404c1839d Reviewed-by: hjk <qthjk@ovi.com>
* C++: Fix a crash in debug builds when rewriting functions.Christian Kamm2011-10-251-0/+5
| | | | | Change-Id: I35266b69d1cc433c4d9176cc849efd03ea1cc1cd Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Added support to C++ symbols rewriting.Roberto Raggi2011-05-171-0/+19
| | | | | | This should simplify full C++ template instantiations. Reviewed-by: Christian Kamm
* remove nokia copyrights from roberto's codeOswald Buddenhagen2011-05-161-31/+0
| | | | | | | | they are lying. nokia has no copyright on this code. and the double license in a single file looks weird. that's why we moved it to 3rdparty/, so it is clear it is not nokia's. Approved-by: legal
* move src/shared/cplusplus/ -> src/libs/3rdparty/cplusplus/Oswald Buddenhagen2011-05-161-0/+442
Approved-by: legal