D18551: clang: Create preamble only on second parse

Aaron Puchert noreply at phabricator.kde.org
Thu Feb 14 23:49:32 GMT 2019


aaronpuchert added a comment.


  In D18551#411905 <https://phabricator.kde.org/D18551#411905>, @rjvbb wrote:
  
  > Indeed, and in that light clang's solution is maybe not that smart, at least not for use as a parser for an entire project. From what I understand that preamble is just a precompiled header file, which in my experience can be tricky to set up (typically require some sort of central header that imports everything that'll be needed everywhere). Having one such preamble per file cannot but duplicate lots of data.
  
  
  You're right, it's a precompiled header file. I think it works very well for the intended purpose: quick reparsing on most user edits. The additional option that we use here was added in https://reviews.llvm.org/D15490 for pure code completion workloads. I don't think it's meant for us, even though we do completion as well: we also build an index, and have possibly many more files open.
  
  >> we could also track dependencies and reparse active documents if a dependency has changed.
  > 
  > I was assuming this is what happens, at least for open files. Of course that could be something done entirely by libclang internally.
  
  Sometimes it works, sometimes it doesn't. Often I have to mock-edit a file to force reparsing when some header has changed.

REPOSITORY
  R32 KDevelop

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

To: aaronpuchert, #kdevelop, mwolff, brauch, rjvbb
Cc: rjvbb, kdevelop-devel, gennad, glebaccon, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190214/380f8f0e/attachment.html>


More information about the KDevelop-devel mailing list