We are seeing issues with path serialization of the
SUBMODULE_TOPHEADER field when the inputs are links. While working
on a fix I noticed this field does not appear to be used anywhere
outside of libclang. This diff removes the field entirely and
updates the libclang API to always return empty top headers.
Details
- Reviewers
akyrtzi dexonsmith
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@akyrtzi it looks like you added this field a while back. Do you know if there are still consumers for the the libclang API, do we need to keep this field around?
The alternative is to refactor the TopHeaders set to use FileEntryRef so that we can keep track of the correct import names for the headers.
This is useful for functionality, like in an IDE, to show the top headers of a module import for navigational purposes.
Is it reasonable to at least have an alternative implementation for it (e.g. from the module headers find the headers that were not included from other headers), not sure if it'd be straightforward or not.
Its feasible to refactor by moving the collectModuleHeaderIncludes function to be a method on Module with a callback. Then we could avoid serializing the top header list and call the method in CIndex as well as FrontendAction. I'll take a look at how much work this is.
Its going to be less work to refactor TopheaderNames to use FileEntryRef, so went that way instead. First step is here: https://reviews.llvm.org/D142113