Ensure -extract-api handles multiple headers correctly
authorDaniel Grumberg <dgrumberg@apple.com>
Thu, 17 Mar 2022 10:50:55 +0000 (10:50 +0000)
committerDaniel Grumberg <dgrumberg@apple.com>
Mon, 21 Mar 2022 21:04:47 +0000 (21:04 +0000)
commitedbb99a7edc6f2dca0ebb27d95c624aa6479eb21
tree4df85e424b28ad70fbfc2104de94f98736d6f134
parente412529c93ae86d580b8212e07a0a2a0a8ab5cda
Ensure -extract-api handles multiple headers correctly

clang -extract-api should accept multiple headers and forward them to a
single CC1 instance. This change introduces a new ExtractAPIJobAction.
Currently API Extraction is done during the Precompile phase as this is
the current phase that matches the requirements the most. Adding a new
phase would need to change some logic in how phases are scheduled. If
the headers scheduled for API extraction are of different types the
driver emits a diagnostic.

Differential Revision: https://reviews.llvm.org/D121936
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Driver/Action.h
clang/include/clang/Driver/Types.def
clang/lib/Driver/Action.cpp
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/extract-api-multiheader-kind-diag.h [new file with mode: 0644]
clang/test/Driver/extract-api-multiheader.h [new file with mode: 0644]
clang/test/Driver/extract-api.h [moved from clang/test/Driver/extract-api.c with 60% similarity]
clang/test/SymbolGraph/global_record.c