Separate the C++ and Objective-C generated header output types.

Otherwise, when an output file map is provided, we'll use the same
path for both. Fixes rdar://87987062.
This commit is contained in:
Doug Gregor
2022-01-25 22:52:13 -08:00
parent bc74ac7a85
commit c7a5049a28
5 changed files with 11 additions and 3 deletions

View File

@@ -1980,7 +1980,8 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
if (Arg *A = Args.getLastArg(options::OPT_import_objc_header)) {
StringRef Value = A->getValue();
auto Ty = TC.lookupTypeForExtension(llvm::sys::path::extension(Value));
if (Ty == file_types::TY_ObjCHeader) {
if (Ty == file_types::TY_ObjCHeader ||
Ty == file_types::TY_CXXHeader) {
auto *HeaderInput = C.createAction<InputAction>(*A, Ty);
StringRef PersistentPCHDir;
if (const Arg *A = Args.getLastArg(options::OPT_pch_output_dir)) {
@@ -2064,6 +2065,7 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
case file_types::TY_LLVM_BC:
case file_types::TY_SerializedDiagnostics:
case file_types::TY_ObjCHeader:
case file_types::TY_CXXHeader:
case file_types::TY_ClangModuleFile:
case file_types::TY_SwiftDeps:
case file_types::TY_ExternalSwiftDeps: