[PATCH] D123148: [clang][extract-api] Process only APIs declared in inputs
Cyndy Ishida via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 5 12:22:39 PDT 2022
cishida added inline comments.
Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:66
+ // Check if we have looked up this particular file entry previously instead
+ // of querying the preprocessor for externsal sources.
+ if (UnknownFileEntries.count(File))
Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:72
+ // primarily to resolve headers found via headermaps, as they remap
+ // locations.
+ const auto *FileInfo = PP.getHeaderSearchInfo().getExistingFileInfo(File);
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.
Comment at: clang/test/ExtractAPI/known_files_only.c:6
+// RUN: %clang -extract-api --product-name=GlobalRecord -target arm64-apple-macosx \
+// RUN: %t/input1.h %t/input2.h %t/input3.h -o %t/output.json | FileCheck -allow-empty %s
It may be useful to add a test for the headermap case to ensure the remapped location is recognized.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits