We should only process APIs declared in the command line inputs to avoid
drowning the ExtractAPI output with symbols the user doesn't care about.
This is achieved by keeping track of the provided input files and
checking that the associated Decl or Macro is declared in one of those files.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/ExtractAPI/ExtractAPIConsumer.cpp | ||
---|---|---|
68 | s/externsal/external | |
74 | How is this searching by the way the header was included? It looks like comparisons are based on file locations as KnownIncludes stores file paths. | |
clang/test/ExtractAPI/known_files_only.c | ||
7 | It may be useful to add a test for the headermap case to ensure the remapped location is recognized. |
Address code review feedback:
- Remove unnecessary code
- Add a test to validate that everything works in the presence of header maps
- Simplify existing test
- Fix small nits
clang/lib/ExtractAPI/ExtractAPIConsumer.cpp | ||
---|---|---|
74 | Upon second thought and further testing all this stuff isn't needed because we always construct the input buffer using #include "ABSOLUTE_PATH". I have added a test to validate that this works when using a header map. If we ever move to relative includes, then we should change how this to use only include string comparisons (potentially caching the FileEntries as a performance optimization). |
s/externsal/external