<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">+Michael, Bruno, and Volodymyr<div class=""><br class=""></div><div class="">I agree with Sam that option 2 seems cleaner. I'm not sure whether 4% (option 1) would be a blocker for us, but probably it would be fine.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 17, 2020, at 10:30, Sam McCall via clangd-dev <<a href="mailto:clangd-dev@lists.llvm.org" class="">clangd-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">+clangd-dev, this is definitely interesting! We hadn't seen such large preambles before.<div class=""><br class=""></div><div class="">I have to confess from the clangd side we've mostly been reusing the modules/preamble format without deeply probing into it, so I don't have an informed opinion (both your options seem reasonable to me, with 2 sounding nicer but more work).</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 17, 2020 at 6:18 PM David Blaikie via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">Subscribing because I'm interested and adding Richard for visibility.</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 17, 2020 at 9:46 AM Dmitry Polukhin via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">Hi all,<div class=""><br class=""></div><div class="">I worked on crashes and asserts on clangd and found that Clang doesn't support PCH files that exceed 512M. It happens because PCH uses *bit* offsets from the beginning of the file for some indexes and other data structures. The simplest example is SOURCE_LOCATION_OFFSETS in source manager block. But there are other similar cases. I identified some cases and made them 64bit to double check my hypotheses. It indeed helped in my case but I see other places where uint32_t is used for storing bit offsets in the file. I see two possible approaches to fix this issue:</div><div class=""><br class=""></div><div class="">1. Use uint64_t in all places where Clang needs bit offset from the beginning of the files. It is relatively straight forwarded approach but it increases file size even if uint32_t is enough. In my case I saw about 4% increase for 700Mb preamble file. Such increase sounds modest to me and I implemented it in <a href="https://reviews.llvm.org/D76295" target="_blank" class="">https://reviews.llvm.org/D76295</a></div><div class=""><br class=""></div><div class="">2. Store offsets from the beginning of corresponding data structure i.e. it will give 512M size limit on individual blocks instead of whole file. It won't increase file size much bit will add some complication of loading/storing logic and may still require 64 bit offsets if it is not possible to find good anchors for relative offsets.</div><div class=""><br class=""></div><div class="">The question is which approach do you think is the best?</div><div class=""><br class=""></div><div class="">Dmitry</div></div>
_______________________________________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="">
</blockquote></div>
_______________________________________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="">
</blockquote></div>
_______________________________________________<br class="">clangd-dev mailing list<br class=""><a href="mailto:clangd-dev@lists.llvm.org" class="">clangd-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev<br class=""></div></blockquote></div><br class=""></div></body></html>