mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
[libc] Include only the relevant header files in the integration test.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
set(PUBLIC_HEADERS
|
||||
libc.include.errno
|
||||
libc.include.math
|
||||
libc.include.stdlib
|
||||
libc.include.sys_syscall
|
||||
)
|
||||
|
||||
@@ -24,9 +24,21 @@ llvm::cl::list<std::string>
|
||||
bool TestGeneratorMain(llvm::raw_ostream &OS, llvm::RecordKeeper &records) {
|
||||
OS << "#include \"TypeTraits.h\"\n";
|
||||
llvm_libc::APIIndexer G(records);
|
||||
for (const auto &header : G.PublicHeaders)
|
||||
std::unordered_set<std::string> headerFileSet;
|
||||
for (const auto &entrypoint : EntrypointNamesOption) {
|
||||
auto match = G.FunctionToHeaderMap.find(entrypoint);
|
||||
if (match == G.FunctionToHeaderMap.end()) {
|
||||
llvm::errs() << "ERROR: entrypoint '" << entrypoint
|
||||
<< "' could not be found in spec in any public header\n";
|
||||
return true;
|
||||
}
|
||||
headerFileSet.insert(match->second);
|
||||
}
|
||||
for (const auto &header : headerFileSet)
|
||||
OS << "#include <" << header << ">\n";
|
||||
|
||||
OS << '\n';
|
||||
|
||||
OS << "int main() {\n";
|
||||
for (const auto &entrypoint : EntrypointNamesOption) {
|
||||
auto match = G.FunctionSpecMap.find(entrypoint);
|
||||
|
||||
Reference in New Issue
Block a user