Skip to content
Snippets Groups Projects
  1. Jan 19, 2016
  2. Nov 19, 2015
    • Nikolai Kosjar's avatar
      C++: Revert lookup to 3.4.2 · 0498fb68
      Nikolai Kosjar authored
      
      ...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:
      
        88c5b47e # CppTools: Minor cleanup in completion tests
        e5255a1f # CppTools: Add a test for ObjC not replacing dot with arrow
        5b12c8d6 # CppTools: Support ObjC in member access operator tests
        9fef4fb9 # 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: default avatarMarco Bubke <marco.bubke@theqtcompany.com>
      0498fb68
  3. Nov 16, 2015
    • Adam Strzelecki's avatar
      CppTools: Do not highlight instantiation as call · 9b3723d6
      Adam Strzelecki authored
      
      Underlying C++ model sometimes marks C++ object instantiation using initializer
      as a (forward) function declaration. This leads to incorrect highlighting of
      object variables as if they were function calls.
      
      C++ model however marks in this case (and not any other case) such symbols as
      ambiguous function types, see CPlusPlus::Bind::visit. This change skips such
      ambiguous functions for highlighting as function call.
      
      Also add test case for related bug report.
      
      Task-number: QTCREATORBUG-15212
      Change-Id: Ifde8db407f2fa8275a3f991bfa3d3b73eca8c14e
      Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      9b3723d6
  4. Jun 09, 2015
  5. Jun 01, 2015
  6. May 27, 2015
  7. Apr 20, 2015
  8. Jan 16, 2015
  9. Oct 23, 2014
  10. Oct 09, 2014
  11. Aug 25, 2014
    • Nikolai Kosjar's avatar
      C++: Base parsing on editor document instead of widget · 89bd4ee3
      Nikolai Kosjar authored
      
      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: default avatarOrgad Shaneh <orgads@gmail.com>
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
      89bd4ee3
  12. Aug 21, 2014
    • Nikolai Kosjar's avatar
      CppTools: Remove concurrent write access to diagnostic messages · 6d70418e
      Nikolai Kosjar authored
      
      ...in CheckSymbols (highlighting backend). CheckSymbols might run
      concurrently several times with the same CPlusPlus::Document and modify
      the diagnostic messages in an unsave manner. See stack straces below.
      
      While the generated diagnostic messages ("Only virtual functions can be
      marked 'final'", "Too few arguments", ...) are useful, they weren't
      propagated to the editor widget since several minor versions.
      
      =================================================================
      ==23724==ERROR: AddressSanitizer: attempting double-free on 0x60c0072fcd00 in thread T528 (Thread (pooled)):
          #0 0x4787c1 in __interceptor_free (/home/nik/dev/creator/creator-ut_clang-qt5/bin/qtcreator+0x4787c1)
          #1 0x7fa15e5da4ac in QTypedArrayData<unsigned short>::deallocate(QArrayData*) /home/nik/usr/qt-5.3.1/include/QtCore/qarraydata.h:234
          #2 0x7fa15e5d87db in QString::~QString() /home/nik/usr/qt-5.3.1/include/QtCore/qstring.h:995
          #3 0x7fa15e5f4f6a in CPlusPlus::Document::DiagnosticMessage::~DiagnosticMessage() /home/nik/dev/creator/creator-ut/src/libs/cplusplus/CppDocument.h:140
          #4 0x7fa15e5f4de2 in QList<CPlusPlus::Document::DiagnosticMessage>::node_destruct(QList<CPlusPlus::Document::DiagnosticMessage>::Node*, QList<CPlusPlus::Document::DiagnosticMessage>::Node*) /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:432
          #5 0x7fa15e5f4ae9 in QList<CPlusPlus::Document::DiagnosticMessage>::dealloc(QListData::Data*) /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:784
          #6 0x7fa15e5f47ed in QList<CPlusPlus::Document::DiagnosticMessage>::~QList() /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:760
          #7 0x7fa15e7533c2 in QList<CPlusPlus::Document::DiagnosticMessage>::clear() /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:793
          #8 0x7fa15e6f2ed2 in CPlusPlus::Document::clearDiagnosticMessages() /home/nik/dev/creator/creator-ut/src/libs/cplusplus/CppDocument.h:205
          #9 0x7fa15e6c5f5b in CppTools::CheckSymbols::run() /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppchecksymbols.cpp:337
          #10 0x7fa15e6c83c2 in non-virtual thunk to CppTools::CheckSymbols::run() /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppchecksymbols.cpp:348
          #11 0x7fa17f0ccab1 (/home/nik/usr/qt-5.3.1/lib/libQt5Core.so.5+0x98ab1)
          #12 0x7fa17f0cfa5e (/home/nik/usr/qt-5.3.1/lib/libQt5Core.so.5+0x9ba5e)
          #13 0x7fa17eaeb181 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8181)
          #14 0x7fa17dbec38c (/lib/x86_64-linux-gnu/libc.so.6+0xfb38c)
      
      0x60c0072fcd00 is located 0 bytes inside of 128-byte region [0x60c0072fcd00,0x60c0072fcd80)
      freed by thread T539 (Thread (pooled)) here:
          #0 0x4787c1 in __interceptor_free (/home/nik/dev/creator/creator-ut_clang-qt5/bin/qtcreator+0x4787c1)
          #1 0x7fa15e5da4ac in QTypedArrayData<unsigned short>::deallocate(QArrayData*) /home/nik/usr/qt-5.3.1/include/QtCore/qarraydata.h:234
          #2 0x7fa15e5d87db in QString::~QString() /home/nik/usr/qt-5.3.1/include/QtCore/qstring.h:995
          #3 0x7fa15e5f4f6a in CPlusPlus::Document::DiagnosticMessage::~DiagnosticMessage() /home/nik/dev/creator/creator-ut/src/libs/cplusplus/CppDocument.h:140
          #4 0x7fa15e5f4de2 in QList<CPlusPlus::Document::DiagnosticMessage>::node_destruct(QList<CPlusPlus::Document::DiagnosticMessage>::Node*, QList<CPlusPlus::Document::DiagnosticMessage>::Node*) /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:432
          #5 0x7fa15e5f4ae9 in QList<CPlusPlus::Document::DiagnosticMessage>::dealloc(QListData::Data*) /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:784
          #6 0x7fa15e5f47ed in QList<CPlusPlus::Document::DiagnosticMessage>::~QList() /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:760
          #7 0x7fa15e7533c2 in QList<CPlusPlus::Document::DiagnosticMessage>::clear() /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:793
          #8 0x7fa15e6f2ed2 in CPlusPlus::Document::clearDiagnosticMessages() /home/nik/dev/creator/creator-ut/src/libs/cplusplus/CppDocument.h:205
          #9 0x7fa15e6c5f5b in CppTools::CheckSymbols::run() /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppchecksymbols.cpp:337
          #10 0x7fa15e6c83c2 in non-virtual thunk to CppTools::CheckSymbols::run() /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppchecksymbols.cpp:348
      
      Change-Id: Ifab2842ea43aeb26099835966b02d8afc4b85df4
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
      6d70418e
  13. Jun 24, 2014
  14. Jun 19, 2014
  15. Jun 17, 2014
    • Wang Hoi's avatar
      C: Parser: Support parsing of c99 designated initializers · c56b999f
      Wang Hoi authored
      
      In case:
      
          int a[6] = { [4] = 29, [2] = 15 };
          struct point { int x, y; };
          struct point p = { .y = 3, .x = 2 };
      
      Grammar change when c99 language feature is enabled:
      old grammar:
      
          braced-init-list :: '{' initializer-list '}'
      
      new grammar:
      
          braced-init-list :: '{' designated-initializer-list '}'
          designated-initializer-list :: designated-initializer (',' designated-initializer )*
          designated-initializer :: designator* initializer-clause
          designator :: '.' identifier
                      | '[' constant-expression ']'
      
      Task-number: QTCREATORBUG-1902
      Change-Id: Ib99d6f553f8d0f50ba3eff86f3a2e86d73372426
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      c56b999f
  16. May 23, 2014
  17. May 15, 2014
  18. Jan 08, 2014
  19. Oct 10, 2013
  20. Aug 22, 2013
  21. Aug 20, 2013
  22. Jul 25, 2013
  23. Jul 17, 2013
  24. Jun 11, 2013
  25. May 24, 2013
  26. Apr 18, 2013
  27. Apr 16, 2013
  28. Apr 10, 2013
  29. Apr 03, 2013
  30. Mar 04, 2013
  31. Feb 26, 2013
    • Erik Verbruggen's avatar
      C++: Fix/tune semantic highlighter result chunk size. · 2d3d53a0
      Erik Verbruggen authored
      
      The fix: when finished with a FunctionDefinition, only flush when the
      number of usages reaches the chunk size. This should prevent a lot of
      chunks with a low number of usages for files with short methods.
      
      The tuning: for files larger than 10000 lines, use a larger chunk size
      to prevent the UI thread from having to re-layout/re-paint too often.
      
      Change-Id: I419174d306b8380c6fa8402825767e26c73f62ec
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      2d3d53a0
  32. Feb 19, 2013
  33. Feb 11, 2013
  34. Jan 30, 2013
  35. Jan 29, 2013
  36. Jan 22, 2013
Loading