summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus
Commit message (Collapse)AuthorAgeFilesLines
* Supply c++11 flags and per-project info to c++ code model.Erik Verbruggen2012-02-162-13/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A manual squash/merge of the changes below, plus a couple of subsequent code fixes. 59085aa5fbb99e2d786cd2c1a06c24a111ccb49f: Modify CppModel::ProjectInfo Adding per project node information, to pass on the correct defines/includes for each file, instead of aggregating them incorrectly. Also split up SOURCES and OBJECTIVE_SOURCES. Also ask the toolchain to convert the compilerflags to flags the codemodel understands, for now only gcc and only c++11. Also make the toolchain aware of the flags used to compile, so that it can emit the correct defines. Note: No header files are passed on. 74028802314cd4e75b41b46407433e07090a304d: GCC: Evaluate cxxflags when checking for predefined macros ebaaa4957e4c02cc9637a998eddae1d0acd74f83: MSVC: Take cxxflags into account when checking for predefined macros 9bfce7e889bcf7bcc47bf880e3ea25945ca7d0d7: Compile fixes Change-Id: I9de94ad038dfc5dc1987732e84b13fb4419c96f5 Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
* Removed module names from #include directives.Erik Verbruggen2012-02-1532-72/+72
| | | | | | | | Getting the #include directives ready for Qt5. This includes the new-project wizards. Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* [C++] Undo accidental commenting-out of NDEBUG flag.Erik Verbruggen2012-02-131-1/+1
| | | | | | | Thanks to Flex Ferrum for spotting it. Change-Id: I66d722a1da6c05c51a4a648453b1da6f2f445212 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++11: first set of changes for decltype.Erik Verbruggen2012-02-103-1/+11
| | | | | Change-Id: I49d6ff7eb1805cd07bdfcb27bb37d4c6cadc9115 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Compile with Qt 5.Friedemann Kleint2012-02-081-0/+2
| | | | | | | | | | | | - QtQuick1 renaming. - Start on qtconcurrent split (pending renaming of Qt Creator's qtconcurrent library). - QWinEventNotifier is a public class in Qt 5. - Metatype system: Classes need to be known. Change-Id: I5582e7cc2777bf791a08b049262217055769c80f Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* C++: Moved completion/highlighting into the model manager.Erik Verbruggen2012-02-081-0/+5
| | | | | | | | | | This way the editor does not need to know all the details of instantiating or maintaining classes for highlighting and/or completion, it can just ask the model manager. The change also enables different highlighting- or completion-engines without changes to the cppeditor. Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* Fix semantic of C++ 11 inline namespaces.Roberto Raggi2012-02-031-0/+4
| | | | | | | | | | Add the declaring `inline' namespace to the `using list' of its enclosing namespace symbol. This should be enough to ensure the correct visibility of the symbols declarated in the inlined namespace. Change-Id: Id4de74577c498fe439a49709a306ef0deb145988 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* C++11: add support for static_assert.Erik Verbruggen2012-02-022-0/+7
| | | | | Change-Id: I82d8d60acaa9265fd25e0a3734855b19bdef9c06 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++11: handle noexcept specifications.Erik Verbruggen2012-02-022-8/+12
| | | | | Change-Id: I7da3affea2758b2e01124105e2521e1f2c5f6678 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Type deduction for auto-declared variables implementedFlex Ferrum2012-01-311-4/+91
| | | | | | | | | | | Handled to major cases of 'auto' variable declaration: 1. auto var = someInitializer; 2. Q_FOREACH(auto item, collection) or foreach(auto item, collection) In first case type deducted directly from initializer. If variable has no initializer then corresponded error reported. In second case type deducted from '*collection.begin()' expression. Change-Id: Ie930add1648b99440281ae04d973fd6904bc9e46 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Find usage displays content of the first lineDavid Schulz2012-01-301-7/+11
| | | | | | | Task-number: QTCREATERBUG-6176 Change-Id: I1c45b951bfde0b0d33bf462f532da7cbdbaa3fe7 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* Long live the king!hjk2012-01-2666-66/+66
| | | | | Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
* C++: Improve file accuracy when finding symbolsLeandro Melo2012-01-232-248/+0
| | | | | | | | | | | | | | | | | | | | | | This patch introduces a priority-based mechanism when searching for certains symbols in the snapshot. The priority corresponds to how similar the file path from the "reference" symbol is to the file path from the "candidate" symbol. This solves a variety of issues when matching "equivalent" symbols but that are in another file/project, such as when following a function declaration, a forward class declaration, or adding a definition through a quickfix. There's now a symbol finder which will compute the "best" search order and cache the most recent results. A consequence is that following symbols in some cases is slower, but not apparently significatly. Note: The "find" functions were moved from the Snapshot to the new SymbolFinder class. Task-number: QTCREATORBUG-6697 Task-number: QTCREATORBUG-6792 Change-Id: Ia518f014275fec1f4d0cb3224bd4e06a9df6d557 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Rename source/setSource to utf8Source/setUtf8SourceLeandro Melo2012-01-134-9/+9
| | | | | | | | Continuinng a previous commit... This is in order to make the interface clearer. Change-Id: Ic1b05217f878578bc84a064927507b75981c47d6 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Accept UTF-8 byte arrays in type of expressionLeandro Melo2012-01-133-30/+26
| | | | | | | | | | | The model uses UTF-8 internally and it makes more sense to only convert when necessary. A following commit will rename the source/setSource methods in document for more clarity too. Change-Id: I960ea0754efabd1436ad4b4299a57faeb65a8bee Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Merge remote-tracking branch 'origin/2.4'Eike Ziller2011-11-251-1/+0
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: qtcreator.pri src/libs/qmljs/qmljstypedescriptionreader.cpp src/plugins/analyzerbase/startremotedialog.ui src/plugins/qmldesigner/designercore/include/rewriterview.h src/plugins/qt4projectmanager/makestep.cpp Change-Id: If9d15a8c8f73106585fd8ce6ac47c253a40af6b1
| * centralize setting of "CONFIG += shared dll" for librariesOswald Buddenhagen2011-11-181-1/+0
| | | | | | | | | | | | | | | | | | | | "dll" and "shared" set each other, but too late to actually test for it in the project files, so include both. note that this will slightly modify the build of some of our imported qt solutions. Change-Id: I0bd4f41a68fd160f8e87eb0a0fa66096fe70ef3e Reviewed-by: Maurice Kalinowski <maurice.kalinowski@nokia.com>
* | C++: Fix completion for namespace aliases at global or namespace scope.Christian Kamm2011-11-221-0/+8
| | | | | | | | | | | | Task-number: QTCREATORBUG-166 Change-Id: Ic0fe4067caad37e51f7e253fd6678a6680350870 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* | C++: Recognize C++11 nullptrLeandro Melo2011-11-184-0/+16
| | | | | | | | | | Change-Id: I5b7ac8f9b2137ffe9439ada4ec4aeb9cee8e249d Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* | C++: Enabled C++0x in SimpleLexerLeandro Melo2011-11-182-0/+15
| | | | | | | | | | | | | | We should create a UI flag for C++0x... Change-Id: Iba30090aa580554af629c0fb59ae5fc22b306b80 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* | C++: Better resolution for typedef when resolving expr.Leandro Melo2011-11-172-5/+41
| | | | | | | | | | | | | | | | | | | | | | | | Example: struct Bar { int m; }; typedef Bar *pBar; pBar b; b-> // completes correctly now Change-Id: I97cc67579b955fe47c68ab6c35be9a054b6d1be9 Done-by: ckamm Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* | Merge remote-tracking branch 'origin/2.4'Eike Ziller2011-11-1166-134/+137
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/qmljs/qmljsinterpreter.cpp src/libs/qmljs/qmljsinterpreter.h src/plugins/debugger/qml/scriptconsole.cpp src/plugins/git/gitplugin.cpp src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
| * C++: Fix crash in type hierarchy when anonymous in typedefsLeandro Melo2011-11-071-2/+5
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-6445 Change-Id: If62745b58cad330c1f6a8605a444ec13644a1f20 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
| * all: s/info@qt.nokia.com/qt-info@nokia.com/hjk2011-11-0366-132/+132
| | | | | | | | | | Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* | Merge remote-tracking branch 'origin/2.4'Eike Ziller2011-11-014-74/+32
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/qmljs/qmljsinterpreter.cpp src/libs/qmljs/qmljsinterpreter.h src/plugins/madde/maemopackagecreationstep.cpp src/plugins/projectexplorer/buildmanager.cpp src/plugins/qmljstools/qmljsqtstylecodeformatter.cpp src/plugins/qmljstools/qmljsqtstylecodeformatter.h tests/auto/qml/qmleditor/qmlcodeformatter/tst_qmlcodeformatter.cpp Change-Id: I63ab2ba5dac006c37ccfbae55b023396a4676ff7
| * C++ insert def: Fix bug when minimizing name.Christian Kamm2011-10-313-71/+29
| | | | | | | | | | | | | | | | | | | | Constructors would not get the correct name before. Now rewriting the function's name is not done by going through the 'rewrite type' func- tionality but rather by minimizing the symbol's name directly. Task-number: QTCREATORBUG-6223 Change-Id: I3c25e414337937f5dd0f54570c899ca2ca21d2ef Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
| * C++: Fix findMatchingDeclaration for functions not in a class.Christian Kamm2011-10-311-3/+3
| | | | | | | | | | | | | | | | | | That fixes navigation and the 'function signature update' quickfix for global functions and functions in namespaces. Task-number: QTCREATORBUG-6413 Change-Id: Ifc68a88a34eb363f4e84c72e9f72444d22df1086 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* | C++: Handle multi-line if/elif directivesLeandro Melo2011-10-311-0/+11
|/ | | | | | | Task-number: QTCREATORBUG-5843 Change-Id: Ie32ed9daadf70f3b972a96fb53edcde9b1debb6c Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* C++: Fix a crash in debug builds when rewriting functions.Christian Kamm2011-10-251-0/+3
| | | | | Change-Id: I35266b69d1cc433c4d9176cc849efd03ea1cc1cd Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* CDB breakpoints: Fix line adjustment in case statements.Christian Kamm2011-10-042-7/+0
| | | | | | | Task-number: QTCREATORBUG-6207 Change-Id: I4df50a412dd960a0d53a824a6c4a93712bd743e8 Reviewed-on: http://codereview.qt-project.org/5964 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* C++: Fix bug in findMatchingDefinition.Christian Kamm2011-09-201-2/+4
| | | | | | | | In strict mode, don't give up after the first Document with candidates. Change-Id: I62ba59708a3501b31f79d979b1a85bede875eccb Reviewed-on: http://codereview.qt-project.org/5142 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++: Fix function return type printing.Christian Kamm2011-09-121-1/+8
| | | | | | | | We used to print T * foo(), but our style suggests T *foo(). Change-Id: Ie3b0ce6b620785ec98aeb394f7955ce959440619 Reviewed-on: http://codereview.qt-project.org/4634 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* add always defined macro Q_CREATOR_RUN to cpp parserBenito van der Zander2011-09-081-1/+2
| | | | | | | | | | Merge-request: 336 Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com> Change-Id: Iefd0c60bb3e78047e28dcff33cc62c15ed11f711 Reviewed-on: http://codereview.qt-project.org/4292 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* QmlJS: Find setContextProperty calls in C++ and expose to QML.Christian Kamm2011-09-082-1/+9
| | | | | | | | Task-number: QTCREATORBUG-3199 Change-Id: I591490ceafadc0f5a07c63ec063f1bdfa7055f47 Reviewed-on: http://codereview.qt-project.org/4074 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* C++: More flexibility for string representation of macrosLeandro Melo2011-09-063-7/+59
| | | | | | | | | | | | | | | It's now possible to get the macro definition with the actual line breaks used on the code. This is particularly useful for tooltips in order for them to look nice. The preprocessor is changed so the macro also stores the breaks positions. This doesn't seem to have any impact on performance. In my machine, for example, the total time for parsing Creator's source code is approx. 18100ms with or without the patch. Change-Id: Ic7487236315c3567d26496315accdb2adfea894a Reviewed-on: http://codereview.qt.nokia.com/4253 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* C++: removed assert that could crash creator. Gracefully exit instead.Erik Verbruggen2011-09-061-1/+2
| | | | | | | Change-Id: Iab79b2548195feb83b3f408f0eb612878454bd47 Reviewed-on: http://codereview.qt.nokia.com/4246 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* C++: Export DiagnosticMessageLeandro Melo2011-08-311-1/+1
| | | | | | | | | This is now necessary due to the recent change that added the non-inline operator==. Change-Id: I62255ddeb09f1e312a802db9733575e73ea56478 Reviewed-on: http://codereview.qt.nokia.com/3928 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* QmlJS: Fix infinite loop when scanning for exported C++ types.Christian Kamm2011-08-313-0/+20
| | | | | | | | | | Setting extra diagnostics would call updateDocument which would in turn trigger another scan. Change-Id: I3810a380cdf716a12767d94ff82dc30f8ae3954d Reviewed-on: http://codereview.qt.nokia.com/3917 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++ preprocessor: Fix multiline tokens in ifdef'ed out blocks.Christian Kamm2011-08-312-12/+43
| | | | | | | Change-Id: If6f9819565f891e861f9e111423d99caa7c0f7aa Reviewed-on: http://codereview.qt.nokia.com/3884 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++/QmlJS: Warnings if C++ based QML type detection fails.Christian Kamm2011-08-301-0/+11
| | | | | | Change-Id: I1e206e09c4068cc541978ee148f9ed8c4138c249 Reviewed-on: http://codereview.qt.nokia.com/3579 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* C++: Don't strip comments from preprocessed source code.Christian Kamm2011-08-253-2/+24
| | | | | | Change-Id: I3a4817d36b9c724abca504c42914a73f97ab34c7 Reviewed-on: http://codereview.qt.nokia.com/3480 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Always remove NumericLiterals when removing the AST.Christian Kamm2011-08-252-8/+3
| | | | | | | | Contrary to StringLiterals, keeping them around is unnecessary. Change-Id: Idc1967c125e1373e69ce4c7640328d323a84ec14 Reviewed-on: http://codereview.qt.nokia.com/3395 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QmlJS: Move the exported-C++-type detection out of C++ code.Christian Kamm2011-08-243-265/+19
| | | | | | | | | | | | It now lives in qmljstools/qmljsfindexportedcpptypes, all in one place. Also ensures that the source code is available when a file is being scanned for QML exports. This will enable checking comments for annotations about the URI a plugin is usually imported as. Change-Id: I1da36d0678e0a8d34b171dbe0f6b5690d89eb18b Reviewed-on: http://codereview.qt.nokia.com/3392 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* C++: Fix completion for typedefs for templates in namespaces.Christian Kamm2011-08-193-21/+46
| | | | | | Change-Id: Ib96551388c94731d97eb8f9728613b120b0b86a9 Reviewed-on: http://codereview.qt.nokia.com/3262 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Refactoring changes: Cleanup and improvements.Christian Kamm2011-08-192-4/+4
| | | | | | | | | | | | | | | | | | Previously RefactoringFiles were usually passed around by value. However, since a RefactoringFile may sometimes own a QTextDocument (when it was read from a file), that's not great and caused the file to be reread after every copy. With this change RefactoringFile becomes noncopyable and is always owned by a shared pointer. This change also allowed having const RefactoringFiles which is useful because they can be safely used from other threads. See CppRefactoringChanges::fileNoEditor. Change-Id: I9045921d6d0f6349f9558ff2a3d8317ea172193b Reviewed-on: http://codereview.qt.nokia.com/3084 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* Header cleanup in various plugins.Friedemann Kleint2011-08-181-4/+0
| | | | | | Change-Id: I16b273cc792bfd2035d35e7c67675f039cd387b9 Reviewed-on: http://codereview.qt.nokia.com/3185 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Disable gcc warning about always-true Q_ASSERT checkKai Koehne2011-08-171-0/+9
| | | | | | | | | gcc 4.5.1 warned about the Q_ASSERT in QStringRef::at() being always false for isCompleteStringLiteral, isCompleteCharLiteral. Change-Id: Idb20f81f92876eff685166c8deeebd6e151303b1 Reviewed-on: http://codereview.qt.nokia.com/3070 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* C++: Fix ::A name handling in findMatchingDeclaration.Christian Kamm2011-08-161-0/+2
| | | | | | | Change-Id: Id158be80c42056c145c2b787d4f569e2c0a0b66e Reviewed-on: http://codereview.qt.nokia.com/2932 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* C++: Synchronize function decl/def refactoring.Christian Kamm2011-08-162-5/+91
| | | | | | | | | | | When editing a function declaration or definition the code model may realize the same changes have to be applied somewhere else. A refactoring marker will pop up that can be clicked to perform the changes. Alternatively, press enter to apply. Change-Id: I2299a2ecfb6a8f87d4853fc7cfa99486f890a1d3 Reviewed-on: http://codereview.qt.nokia.com/2909 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++: Fix off-by-one in scopeAt.Christian Kamm2011-08-101-1/+1
| | | | | | | | | The only Scope that set the end offset to *before* the last token was ObjCClassDeclaration. Change-Id: Icbdb5bcdd72d96087ac586ad51510fed74a633eb Reviewed-on: http://codereview.qt.nokia.com/2820 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>