Commit Graph

566 Commits

Author SHA1 Message Date
Orgad Shaneh
13e3c9bc03 C++: Cleanup long CheckSymbols test
Change-Id: I2d1d75d150e4072e649f77e6e46c9a3256f3194b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-22 11:47:08 +00:00
Orgad Shaneh
cb350bfeb2 C++: Rename ClassOrNamespace -> LookupScope
Change-Id: Ide74482b133dd1fec40a725d9aa81bd749385f37
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-20 14:51:56 +00:00
Orgad Shaneh
29ac9fc65f C++: Remove DeprecatedGenTemplateInstance
It's, well, deprecated...

Change-Id: Ie9d7e80345a8d9404f702dd877b3e940a1a49d93
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-20 13:37:35 +00:00
Orgad Shaneh
a341094a68 C++: Fix preprocessing of comments within function-like macro
Task-number: QTCREATORBUG-9535
Change-Id: Ifd94f674214314b3694be74cca297ddab873cd8c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-13 14:34:07 +00:00
Nikolai Kosjar
4e1d281963 C++: Fix crash on invalid function qualified name
Task-number: QTCREATORBUG-14135
Change-Id: I94e850f729bd3dbf4212960c7a980a1f118030b4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-13 13:21:04 +00:00
Orgad Shaneh
c9b71a268b C++: Provide better output on preprocessor test failure
Make the expected output copyable to the test.

Change-Id: I4fc61682f14d0de054a11d2ffa4a0f36ede0e500
Reviewed-by: Francois Ferrand <thetypz@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-13 11:28:11 +00:00
Orgad Shaneh
d63624afe0 C++: Accept language features in BackwardsScanner et al
Change-Id: Id97ca27fa909979573efca12dc0cd14b28eacd17
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-27 15:11:14 +00:00
Francois Ferrand
1336502f58 C++: fix parsing nested C99 designated initializers.
Change-Id: Iaa0e7550abf6be77601b1852652bb3d0731d0323
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-27 14:49:55 +00:00
Przemyslaw Gorszkowski
9e513774b1 C++: resolved self-value reference for enum
Added support for resolving case:
enum E
{
  val1,
  val2 = val1, // val2-4 are not resolved
  val3,
  val4
};

Task-number: QTCREATORBUG-13932
Change-Id: I122c5eb0b0397d6c02bc3db0a5c1ea1c28c5c6e7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-25 15:01:02 +00:00
Adam Strzelecki
425811291d C++: Basic support for C++11 user-defined literals
1. Extends lexer so digit or string can be followed by underscore '_' and
   alphanumeric defining literal.

2. Extends parser so it accepts operator"" _abc(...) user-defined literal
   definition.

3. Adds Token::Flags.userDefinedLiteral bool flag field representing if token
   carries user-defined literal.

4. Adds C++11 auto tests case with: 12_km, 0.5_Pa, 'c'_X, "abd"_L, u"xyz"_M

5. All optional suffix scanning methods now return boolean if the suffix was
   found.

6. Adds C++ Lexer tests for user-defined literals with C++11 feature enabled.

This change however does not make QtCreator understand user-defined literal
semantics, e.g. properly resolve type when applying custom literal operator.

Change-Id: I30e62f025ec9fb11c39261985ea4d772b1a80949
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-17 09:45:34 +00:00
Eike Ziller
56aadc407d Merge remote-tracking branch 'origin/3.3'
Conflicts:
	src/plugins/debugger/watchhandler.cpp
	src/plugins/projectexplorer/kitmodel.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
	src/shared/qbs

Change-Id: I6a68090993a264e93ac7850858cc24ba6bdb5602
2015-02-12 17:36:29 +01:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Nikolai Kosjar
921ec6da5a C++: Cache parsing of template ids
...in order to stop memory intensive parsing for invalid code.

Parsing the test data/snippet "hard" led to a memory consumption of
about 5.5MB and this could easily get up to hundreds/gigabytes by adding
some more "if_<bool_<true>,\n" lines. With the caching, we are at about
1.0MB, even if more lines are added.

The "memory consumption" was measured with valgrind-massif. The stated
numbers are the reported peaks.

Task-number: QTCREATORBUG-12890
Change-Id: Ie7eb00cfc7915552d29bb27410a6b13a486f486e
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-02-12 10:40:14 +00:00
Nikolai Kosjar
ae3aa07c4d C++: Remove workaround for crashing if parsing invalid code
This reverts the changes

    commit beac7b9539
    C++: Fix highlighting after "invalid code"

    commit 78ab287fc6
    C++: Stop parsing a declaration after two tries

which were a work around for QTCREATORBUG-12890.

A follow-up patch provides a proper fix.

Task-number: QTCREATORBUG-12890
Change-Id: I2650a8e41c8ff1180cad9f069e463fc51bd2f1b1
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-02-12 10:39:51 +00:00
Orgad Shaneh
65e7db42b8 C++: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-04 15:27:22 +00:00
Orgad Shaneh
75a943ef57 C++: Fix crash when #if[def] nesting is deeper than 512 levels
Change-Id: I5e86da3a36514545834f554470b147ad8be43344
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 12:03:29 +00:00
Nikolai Kosjar
56dab9e931 C++: Check for cycled parents
In the struct _Wrap_alloc (see test code) the rebind struct has
_Wrap_alloc as parent. However, within rebind the typedef of type
_Wrap_alloc has rebind as parent.

We will refactor that in master by introducing a "parent iterator"
class checking for cycles, so the client code looks less noisy.

Task-number: QTCREATORBUG-13703
Change-Id: I7b6cf819ea869139d2403e15ba085d8fba19763e
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-01-23 11:41:36 +01:00
Orgad Shaneh
c24ffc4dee C++: Expand arguments in nested function-like macros
Task-number: QTCREATORBUG-13219
Change-Id: I319fe39d696ccc28230d421b1395faf4dd452b03
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-21 13:23:38 +01:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Przemyslaw Gorszkowski
9e159d87a8 C++: display enum value in tooltip for simplest case
If it is possible lets calculate enum value for the simplest case.
Example where it works:
enum
{
  enum_val1, // tooltip = "enum_val1 = 0"
  enum_val2 // tooltip = "enum_val2 = 1"
};

enum
{
  enum_val1=10, // tooltip = "enum_val1 = 10"
  enum_val2 // tooltip = "enum_val2 = 11"
};

enum
{
  enum_val1, // tooltip = "enum_val1 = 0"
  enum_val2=10, // tooltip = "enum_val2 = 10"
  enum_val3 // tooltip = "enum_val3 = 11"
};

Example where it does not work:
enum
{
  enum_val1=10+1, // tooltip = "enum_val1 = 10+1"
  enum_val2 // tooltip = "enum_val2"
};

Task-number: QTCREATORBUG-4529
Change-Id: Idd85ed7304018f73f2b068bf1ac28f1abde02f93
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-01-14 08:10:58 +01:00
Orgad Shaneh
5a5acd664e Tests: Fix MSVC warnings
Change-Id: If7f67ffc68ef725554e9ebaf8a8db5a64b7309cb
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-13 12:08:13 +01:00
Nikolai Kosjar
6cafc424e8 CppTools: Tests: Stop writing into source dir
Instead, always write into a unique temporary directory in
QDir::tempPath().

Where applicable, read the test source from files instead of first
writing the file.

Some clean ups in test_codegen*.

Change-Id: Id48dc50c6ca16252edfd9fc8a86ba0de9f9be486
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-19 10:29:16 +01:00
Erik Verbruggen
242b3f4110 C++: clean up numeric literal parsing and add support for n3472.
Separate the messy pp-number parsing from the numeric literal parsing.
The C/C++ preprocessor makes a grown man cry, but at least we have
"proper" literal parsing when we want it, including C++1y binary
literals.

Next step is digit separators (n3781).

Change-Id: Ia069eef454ed5c056f77694a5b8a595d0b76adc4
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-18 15:46:22 +01:00
Nikolai Kosjar
e3977de08e C++: Finish gcc's include_next support
This implements the actual include_next logic and thus completes

    commit b934cc1
    C++: pass #include_next down to CppPreprocessor::tryIncludeFile

    commmit 140b502
    C++: Highlight argument to gcc's #include_next extension

Based on https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html

Task-number: QTCREATORBUG-10225
Change-Id: I7eef7f5ea64a114f6d092304d32b72c55c2ce134
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-12-15 15:37:36 +01:00
Nikolai Kosjar
2fc4acbc35 CppEditor: Avoid duplicate "Add #include XYZ"
Task-number: QTCREATORBUG-13422
Change-Id: I3648bf44760fdac4e8e1e79652519136af6032c8
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-28 14:01:10 +01:00
Nikolai Kosjar
beac7b9539 C++: Fix highlighting after "invalid code"
For the semantic info document we do not expand function like macros and
because of that certain macro invocations lead to invalid code that we
need to handle, e.g.:

	Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder)
	class Foo {};

This change makes parsing Foo in the semantic info document successfully
again, which affects highlighting of that class.

Change-Id: I389265ac64d3f0b8b8f406d38fa58d78820b14ba
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2014-11-19 16:10:56 +01:00
Nikolai Kosjar
69504c25ca C++: Document::functionAt provides line information
Needed for the debugger.

Change-Id: I6465f6dc53017df212e403ea8a9a1c7977ac1671
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-12 12:29:51 +01:00
Nikolai Kosjar
cefd1832ce C++: Include class name for inline functions in functionAt
The code that constructed the fully qualified name used
enclosingNamespace() which skips classes.

Use LookupContext::fullyQualifiedName() instead.

Change-Id: Ic03a91c0fe120c52dc69f3e78e82a574458d8314
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-11 11:50:46 +01:00
Nikolai Kosjar
079e7a500f C++: Tests: Make document_functionAt data driven
Change-Id: I8e811b21c584e7b6a2b8eb61830cb680f6fefa95
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-11 11:23:13 +01:00
Christian Kandeler
9d677e3302 qbs build: Remove unneeded import statements.
The respective items are available without it.

Change-Id: Idc840cf08e7bec84f561c096afe8de25b1fb8468
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-11-10 15:45:14 +01:00
Orgad Shaneh
e871225057 C++: Add a failing test for pp concat bug
Task-number: QTCREATORBUG-13219
Change-Id: I6278d7977f0ce560e793838c90cfbc867e1af025
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 08:52:31 +01:00
Orgad Shaneh
b4112d7806 Tests: Fix compilation
Broken by ca151d07fa.

Change-Id: Ic6b58b5749d5811d1250840c81d692837e9a2cea
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 08:18:28 +01:00
Nikolai Kosjar
390b4f0e0b C++: Fix parsing of "Foo *foo = new Foo()"
It should be parsed as an DeclarationStatement, but instead it was
parsed as an ExpressionStatement.

Regression introduced with

    commit d3c5fff66d.
    C++: Fix expensive parsing of expressions

The introduced ASTCache did not save the correct return value of a
parse* function. Because of that, the first return in
Parser::parseExpressionList returned false on the second invocation
(cache hit), instead of true, which resulted in an ExpressionStatement.

Task-number: QTCREATORBUG-13122
Change-Id: I8dbd8852b0909edddcd3195b484f4cea92328cc5
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-15 10:08:19 +02:00
Eike Ziller
ea27143239 Merge remote-tracking branch 'origin/3.2'
Conflicts:
	src/libs/utils/ipaddresslineedit.cpp
	src/libs/utils/logging.h
	src/plugins/analyzerbase/AnalyzerBase.pluginspec.in
	src/plugins/android/Android.pluginspec.in
	src/plugins/android/androiddeploystep.cpp
	src/plugins/android/androiddeploystep.h
	src/plugins/android/androiddeploystepfactory.cpp
	src/plugins/android/androiddeploystepwidget.cpp
	src/plugins/android/androidpackagecreationfactory.cpp
	src/plugins/android/androidpackagecreationstep.cpp
	src/plugins/android/androidpackagecreationstep.h
	src/plugins/android/androidpackagecreationwidget.cpp
	src/plugins/android/androidpackagecreationwidget.h
	src/plugins/android/javafilewizard.cpp
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/baremetal/BareMetal.pluginspec.in
	src/plugins/bazaar/Bazaar.pluginspec.in
	src/plugins/beautifier/Beautifier.pluginspec.in
	src/plugins/bineditor/BinEditor.pluginspec.in
	src/plugins/bookmarks/Bookmarks.pluginspec.in
	src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in
	src/plugins/clangcodemodel/clanghighlightingsupport.cpp
	src/plugins/clangcodemodel/clangsymbolsearcher.cpp
	src/plugins/classview/ClassView.pluginspec.in
	src/plugins/clearcase/ClearCase.pluginspec.in
	src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in
	src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp
	src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
	src/plugins/coreplugin/Core.pluginspec.in
	src/plugins/cpaster/CodePaster.pluginspec.in
	src/plugins/cppeditor/CppEditor.pluginspec.in
	src/plugins/cppeditor/cppfilewizard.cpp
	src/plugins/cpptools/CppTools.pluginspec.in
	src/plugins/cpptools/cpphighlightingsupportinternal.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.h
	src/plugins/cvs/CVS.pluginspec.in
	src/plugins/debugger/Debugger.pluginspec.in
	src/plugins/designer/Designer.pluginspec.in
	src/plugins/diffeditor/DiffEditor.pluginspec.in
	src/plugins/emacskeys/EmacsKeys.pluginspec.in
	src/plugins/fakevim/FakeVim.pluginspec.in
	src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in
	src/plugins/git/Git.pluginspec.in
	src/plugins/git/gitorious/gitorious.cpp
	src/plugins/git/gitorious/gitorious.h
	src/plugins/git/gitorious/gitoriousclonewizard.cpp
	src/plugins/git/gitorious/gitorioushostwidget.cpp
	src/plugins/git/gitorious/gitorioushostwidget.h
	src/plugins/git/gitorious/gitorioushostwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.h
	src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwizardpage.h
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.h
	src/plugins/glsleditor/GLSLEditor.pluginspec.in
	src/plugins/glsleditor/glsleditorfactory.cpp
	src/plugins/glsleditor/glslfilewizard.cpp
	src/plugins/helloworld/HelloWorld.pluginspec.in
	src/plugins/help/Help.pluginspec.in
	src/plugins/imageviewer/ImageViewer.pluginspec.in
	src/plugins/ios/Ios.pluginspec.in
	src/plugins/macros/Macros.pluginspec.in
	src/plugins/mercurial/Mercurial.pluginspec.in
	src/plugins/perforce/Perforce.pluginspec.in
	src/plugins/projectexplorer/ProjectExplorer.pluginspec.in
	src/plugins/pythoneditor/PythonEditor.pluginspec.in
	src/plugins/pythoneditor/pythoneditorwidget.cpp
	src/plugins/pythoneditor/wizard/pythonfilewizard.cpp
	src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in
	src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
	src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in
	src/plugins/qmakeprojectmanager/profileeditorfactory.cpp
	src/plugins/qmldesigner/QmlDesigner.pluginspec.in
	src/plugins/qmljseditor/QmlJSEditor.pluginspec.in
	src/plugins/qmljseditor/qmljseditorfactory.cpp
	src/plugins/qmljstools/QmlJSTools.pluginspec.in
	src/plugins/qmlprofiler/QmlProfiler.pluginspec.in
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in
	src/plugins/qnx/Qnx.pluginspec.in
	src/plugins/qtsupport/QtSupport.pluginspec.in
	src/plugins/remotelinux/RemoteLinux.pluginspec.in
	src/plugins/resourceeditor/ResourceEditor.pluginspec.in
	src/plugins/resourceeditor/resourcewizard.h
	src/plugins/subversion/Subversion.pluginspec.in
	src/plugins/tasklist/TaskList.pluginspec.in
	src/plugins/texteditor/TextEditor.pluginspec.in
	src/plugins/texteditor/basetexteditor_p.h
	src/plugins/texteditor/basetextmark.cpp
	src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h
	src/plugins/texteditor/codeassist/defaultassistinterface.h
	src/plugins/texteditor/codeassist/iassistproposalitem.cpp
	src/plugins/texteditor/itexteditor.cpp
	src/plugins/texteditor/itexteditor.h
	src/plugins/texteditor/itextmark.cpp
	src/plugins/texteditor/plaintexteditor.cpp
	src/plugins/texteditor/plaintexteditor.h
	src/plugins/texteditor/texteditoractionhandler.cpp
	src/plugins/todo/Todo.pluginspec.in
	src/plugins/updateinfo/UpdateInfo.pluginspec.in
	src/plugins/valgrind/Valgrind.pluginspec.in
	src/plugins/vcsbase/VcsBase.pluginspec.in
	src/plugins/welcome/Welcome.pluginspec.in
	src/plugins/winrt/WinRt.pluginspec.in
	tests/auto/debugger/temporarydir.h

Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
2014-10-14 15:36:16 +02:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Nikolai Kosjar
c2e5f1c819 C++: Pass on the byte offsets of macro arguments
...to the Document/Block.

Change-Id: I1a96dc70ac93254e6030326b36a5df9a2cdc2bd8
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-10-08 09:51:17 +02:00
Nikolai Kosjar
4da91bef8d C++: Fix endless loop in lookup on Windows
...for templates with typedefs referencing the respectively other
template (basic_ostream <-> ostreambuf_iterator).

Tested with MSVC 2013.

Regression introduced by ba42ceb0cb.

Task-number: QTCREATORBUG-13064
Task-number: QTCREATORBUG-13065
Change-Id: I71a45c720663a73c3302eb7da731e6ad2d8f0fbd
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-09-25 11:35:47 +02:00
Nikolai Kosjar
c9f309f9be C++: Tests: Extract some functions in tst_checksymbols
...so we can use them in a follow-up change.

Change-Id: I0ddc5bb966e72ab5c527f6814650d70492bbbdb5
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-09-25 11:29:23 +02:00
Oswald Buddenhagen
ca492c8fac use DISTFILES instead of OTHER_FILES in creator's own build system
it's the correct variable to use.

Change-Id: I9ec7795099097715a64969516cd3fae9e213a0f4
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-09-15 12:10:01 +02:00
Nikolai Kosjar
89bd4ee3c4 C++: Base parsing on editor document instead of widget
This mainly takes CppEditorSupport apart.

* Parsing is now invoked by CPPEditorDocument itself by listening to
  QTextDocument::contentsChanged().

* Upon construction and destruction CPPEditorDocument creates and
  deletes an EditorDocumentHandle for (un)registration in the model
  manager. This handle provides everything to generate the working copy
  and to access the editor document processor.

* A CPPEditorDocument owns a BaseEditorDocumentProcessor instance that
  controls parsing, semantic info recalculation and the semantic
  highlighting for the document. This is more or less what is left from
  CppEditorSupport and can be considered as the backend of a
  CPPEditorDocument. CPPEditorDocument itself is quite small.

    * BuiltinEditorDocumentProcessor and ClangEditorDocumentProcessor
      derive from BaseEditorDocumentProcessor and implement the gaps.

    * Since the semantic info calculation was bound to the widget, it
      also calculated the local uses, which depend on the cursor
      position. This calculation got moved into the extracted class
      UseSeletionsUpdater in the cppeditor plugin, which is run once the
      cursor position changes or the semantic info document is updated.

    * Some more logic got extracted:
	- SemanticInfoUpdater (logic was in CppEditorSupport)
	- SemanticHighlighter (logic was in CppEditorSupport)

    * The *Parser and *Processor classes can be easily accessed by the
      static function get().

* CppHighlightingSupport is gone since it turned out to be useless.

* The editor dependency in CompletionAssistProviders is gone since we
  actually only need the file path now.

Change-Id: I49d3a7bd138c5ed9620123e34480772535156508
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-25 13:06:01 +02:00
Erik Verbruggen
271c1bb89a C++: change return type to enum.
And not have it converted to int after converting to unsigned.

Change-Id: If95caec46936c2a140c3fbd668fa2f085a9287ed
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-20 14:08:48 +02:00
Nikolai Kosjar
6a9ae7e25f CppTools: Auto-include pre-compiled headers
So far the pre-compiled headers were processed (thus defines from those
headers were visible), but the actual includes for the documents were
not added, which is necessary for lookup/completion.

Note that this will be only done if pre-compiled headers are not ignored
(Options > C++ > Code Model > [] Ignore pre-compiled headers).

Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-24 12:25:02 +02:00
Nikolai Kosjar
d3c5fff66d C++: Fix expensive parsing of expressions
For expression statements like "(g(g(g(...(g(0))...))))" we reparsed
quite much again and again for nothing. The high-level trace for this
expression looks like this:

    parseCastExpression
      parseTypeId
        parseAbstractDeclarator
          parseAbstractCoreDeclarator
          parseParameterDeclarationClause (--> DEEP)
            ...

      parseUnaryExpression
        ...
        parseCorePostfixExpression
          parseTypeId (--> DEEP)
          parsePrimaryExpression (--> DEEP)

Especially parseTypeId is expensive in this case and it's called two
times, both from the same token (index).

With this patch, we remember for certain ASTs the parse results and
re-use them when needed.

Change-Id: I013d1c064c655636bc94db408097863b5e183fc2
Task-number: QTCREATORBUG-12252
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-24 12:06:50 +02:00
Nikolai Kosjar
1926493fe9 C++: Tests: Run ASTVisitor on parsed document
...as a sanity check.

Change-Id: I391276e41c5180d0df72fa6267f58801bf2d5da3
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-24 12:06:36 +02:00
Erik Verbruggen
45b1169d06 C++: Support alignas in C++11 mode.
Change-Id: Ifa81a481bf92b5b71495a105ae292f3e9895f704
Task-number: QTCREATORBUG-9279
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-22 16:43:51 +02:00
Erik Verbruggen
5d45e0b69a C++: block recursion when parsing subsequent case statements.
A case or a default statement must be followed by another statement.
When a such a case (or default) statement is followed immediately by
another case (or default) statement, then this would create a linked
list, and the parser will recurse to parse such input.

In order to prevent the parser running out of stack space while
recursing, parse this corner case by blocking parsing a labeled
statement as the first statement after a labeled statement.

The advantage is that these statements do not form a linked list, so any
subsequent visitation of the AST won't run out of stack space either.

Change-Id: Id2111a49509132997f5fbe4bb12c92c729ec2522
Task-number: QTCREATORBUG-12673
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-22 15:45:02 +02:00
Nikolai Kosjar
33a80e56cc C++: Fix return type of lambda
Relying on "_type" for the lambda was wrong.

In case of the bug report the return type of the lambda happened to be
the template class. Because of that Clone never stopped cloning.

Change-Id: I377d12e6a8278198abd1488fbdbc89b4157c1357
Task-number: QTCREATORBUG-12631
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-10 12:12:46 +02:00
Nikolai Kosjar
04d655dee0 C++: Fix preprocessor line offsets
In TranslationUnit, the "normal" lines are based on utf16char offsets,
but the preprocessor lines were based on byte/latin1 offsets.

The preprocessor lines are now based on utf16char offsets, too.

Task-number: QTCREATORBUG-7356
Change-Id: I3c41d1dcee8e9e487210f36da806b0229d3f4cd0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-04 14:03:44 +02:00
Nikolai Kosjar
06e2c3309e C++: Fix "duplicate data type in declaration" for lambdas
The "_type" wasn't reset.

Task-number: QTCREATORBUG-12521
Change-Id: I0d38cb38e270260065313d1235d42f2689385850
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-04 12:29:28 +02:00
Nikolai Kosjar
38b8940bd4 C++: Fix parsing designators vs lambdas
The introduction of C99 designators led to parsing problems with lambdas
that were passed in as a function arguments.

Fixed by prefering to parse without designators first. This will be
cleaner/clearer once the appropriate "LanguageFeatures" from the Project
Parts will be passed in.

Change-Id: Ia9cb7c4a4c9345e729cf2044e1e5411fe63e33ec
Reviewed-by: Wang Hoi <wanghoi@126.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-24 16:14:40 +02:00