[cfe-dev] RFC: Adding index-while-building support to Clang

Nathan Hawes via cfe-dev cfe-dev at lists.llvm.org
Tue Aug 29 15:33:12 PDT 2017



> On Aug 29, 2017, at 12:34 AM, Manuel Klimek <klimek at google.com> wrote:
> 
> Hi, thanks for the details design, I'm really looking forward for having this :)
> 
> On a high level, I think this all makes lots of sense. 
> I have one question about how things get deleted: will record files for headers be deleted at some point, or will they be kept around, and you have to look at all unit files to see whether a given record file is still valid?

Sorry, I was a bit light on detail in this area. We have a currently unimplemented API in libIndexStore that’s intended to purge unit files whose corresponding main source files no longer exist (e.g. after a .cpp file is renamed) along with any unreferenced record files, but this was more intended as a periodic clean up operation.

In the current design we expect stale units/records to exist in the store and leave it as the responsibility of the index store client to subscribe to the unit added/removed/modified events in order to track enough information to identify and ignore them, e.g. by maintaining reference counts for each record file. When to actually remove them is also left to the client – the index store just provides APIs for deleting individual records/units.

Cheers,
Nathan

> 
> Cheers,
> /Manuel
> 
> 
> On Tue, Aug 29, 2017 at 2:18 AM Nathan Hawes <nhawes at apple.com <mailto:nhawes at apple.com>> wrote:
> Hey everyone,
> 
> Xcode 9 shipped with index-while-building functionality based on enhancements to Clang that we’d like to upstream. Key among them is a new option, -index-store-path, that in addition to Clang's usual outputs, causes it to write out indexing data at the supplied path with minimal overhead.
> 
> While the current implementation is available at https://github.com/apple/swift-clang <https://github.com/apple/swift-clang>, we’d like to start by getting feedback on the high-level design, which you can read about here: https://docs.google.com/document/d/1cH2sTpgSnJZCkZtJl1aY-rzy4uGPcrI-6RrUpdATO2Q/edit?usp=sharing <https://docs.google.com/document/d/1cH2sTpgSnJZCkZtJl1aY-rzy4uGPcrI-6RrUpdATO2Q/edit?usp=sharing>
> 
> Please let us know of any concerns, comments or questions you have regarding this feature.
> 
> Thanks!
> Nathan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170829/5bfb9579/attachment.html>


More information about the cfe-dev mailing list