Commit Graph

8 Commits

Author SHA1 Message Date
Nikolai Kosjar
2d27c55310 Clang: Suspend least recently used translation units
...to free some memory.

The translation units of the 7 most recently used documents ("hot
documents", tracked by document visibility) are kept in memory.
Translation units of other documents are suspended and will be resumed
once they become visible again.

The resumption of a translation unit needs the same time as reparse
(since it is a reparse effectively).

The number of hot documents can be modified by the run time environment
variable QTC_CLANG_HOT_DOCUMENTS=N. Visible documents are always hot.

Task-number: QTCREATORBUG-11640
Change-Id: I68ecd2b1373e303372300203e42d90f65a4b39b3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:27:32 +00:00
Nikolai Kosjar
c2cfc62f08 Clang: Use document visibility as jobrequest conditions
This is in preparation for a follow-up change that will add jobs that
also operate on invisible documents.

Change-Id: I2a0fc3b95cc5ab2e267429134a534df64c901376
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:26:53 +00:00
Nikolai Kosjar
643854cb8b Clang: Fix incomplete JobRequest in tests
Change-Id: Ibbe8f2722c81393d997efb33e6b29e01fde5eee7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-08-03 08:26:49 +00:00
Nikolai Kosjar
ca72c29462 Clang: Provide highlighting for identifier under cursor
Change-Id: I80ffe23cbcc84ab7323124581d9dd6afbe974fd0
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-06-14 12:49:05 +00:00
Nikolai Kosjar
de5cbacae5 Clang: Rename JobRequest::Requirements to ExpirationsReasons
...to avoid ambiguity in regard to a new enum in a follow-up change.

Change-Id: I4f732b5200ed674b6708510ac8de0a795afe52da
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-06-14 11:48:54 +00:00
Nikolai Kosjar
bf5c1cc4fb Clang: Avoid duplicate jobs without changes in-between
This could happen, e.g. with this message order:

  >>> updateTranslationUnitsForEditor()
  add job<1>
  run job<1>
  >>> updateVisibleTranslationUnits(Utf8String(), {})
  >>> updateVisibleTranslationUnits(path, {path})
  add job<2>
  finish job<1>
  run job<2> -- Ops, nothing is changed but job<2> is started

This led to an outdated translation unit (e.g. wrong highlighting).

Now JobQueue checks for duplicates in the queue and checks all the
currently running jobs.

Change-Id: I05843fddcbd21ce0489681c283227c0027ded428
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-10 12:37:20 +00:00
Nikolai Kosjar
c8cec2dd0d Clang: Base JobQueue on translation unit
This enables a job per translation unit instead of per document.

This does not change any behavior yet.

Change-Id: Iafb8dab5da32b53dbb3010c16241bf89cbb81b38
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-10 12:36:33 +00:00
Marco Bubke
47c01daeb2 UnitTest: Cleanup
Improve naming and introduce googletest.h.

Change-Id: I445c13db4c23d6dd5682ce0db3b83055cc6b8a89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-19 15:17:54 +00:00