<div dir="ltr">Hi Argyrios,<div><br><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>In our implementation we use LMDB (<a href="https://symas.com/lightning-memory-mapped-database" target="_blank">https://symas.com/lightning-<wbr>memory-mapped-database</a>). It is a key-value data-store that we use for cross-referencing queries, similarly to the example that Nathan provides in the document.<br></div><div>Is this something that we could accept into the clang project (e.g. in clang-tools-extra) ? Note it is essentially a single header and implementation file.<br></div></div></blockquote><div>AFAIK, LLVM's policy on dependencies is pretty tight. Is it hard to isolate the DB layer or it tightly coupled to the implementation?</div><div>If it's possible, we could include have DB-agnostic API in cfe or clang-tools-extra and an alternative implementation of the storage layer.</div><div>+klimek, +bkramer, maybe you could comment on adding the new third-party dependencies to LLVM? Is it possible?</div><div><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><span class="gmail-"><blockquote type="cite"><div dir="ltr"><div>2.  In clangd, we're not controlling the build step, instead building ASTs in-memory. We would rather store the indexing information in-memory or consume it on the go while building ASTs.<br></div><div>Do you have suggestions on which parts of the API we should look at?</div><div>We could implement our own IndexASTConsumer, but are there more opportunities for reusing other parts of your implementation? Code for collecting indexing dependencies, definitions of high-level record structures (i.e. symbol definitions, etc.)?</div></div></blockquote></span><div>There are a few ways to go about this:</div><div>- Have ASTs in-memory, but indexing works on the file system. It’s not ideal but it is simple and works fairly well in practice, particularly since in our platform, files open in Xcode can be saved in disk even without having the user explicitly saving them.<br></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div>- Update clang’s raw index data store using the in-memory buffers and ASTs. The simplicity is that symbol info comes from one place only, but there’s complexity in that you have raw data on disk that reflect in-memory-only sources.</div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div>- The layer on-top of clang's raw index data store is enhanced to treat the raw data on-disk as one source of symbol info, and in-memory ASTs as another. For example, if using LMDB, you could have it distinguish that info about a symbol comes from the raw data on-disk vs an in-memory AST.</div></div></div></blockquote><div>Thanks. We probably want some combination of all options. We would definitely benefit from reading the on-disk indexes. if they are there. But those may be outdated, so we could our own indexing have a layer on top of that for the modified files. Than we could dispatch all requests to both layers and combine the results. Wonder if it's possible to make it work and how much effort is it.</div></div>
</div></div></div></div>