D18551: clang: Create preamble only on second parse

Aaron Puchert noreply at phabricator.kde.org
Wed Feb 6 00:35:16 GMT 2019


aaronpuchert added a comment.


  In D18551#405494 <https://phabricator.kde.org/D18551#405494>, @rjvbb wrote:
  
  > I can't say that it happens systematically but neither that it does NOT happen systematically, and I mean that in general: re-opening a file you just closed.
  >
  > Isn't this unavoidable BTW, given that we don't end up with preambles of all files?
  
  
  Yes, we don't keep these. But my understanding is that we translate Clang's index into our own (the mystical DUChain) and when opening a file it might not be necessary to reparse the file, if we still have everything we need in our own data structures. Then I'm also not sure if we actually "reparse" (i.e. call `clang_reparseTranslationUnit`) the translation unit that we still have laying around, but have "suspended" with `clang_suspendTranslationUnit`, or if we create a new one. I don't see us calling the latter function, so I assumed we just dispose the translation unit (`clang_disposeTranslationUnit`), meaning that we have to create it again when opening it — which would make it the first parse, not the first reparse.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D18551

To: aaronpuchert, #kdevelop, mwolff, brauch, rjvbb
Cc: rjvbb, kdevelop-devel, glebaccon, hase, antismap, iodelay, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190206/76053f41/attachment-0001.html>


More information about the KDevelop-devel mailing list