diff --git a/llvm/include/llvm/BinaryFormat/MachO.h b/llvm/include/llvm/BinaryFormat/MachO.h --- a/llvm/include/llvm/BinaryFormat/MachO.h +++ b/llvm/include/llvm/BinaryFormat/MachO.h @@ -495,7 +495,8 @@ PLATFORM_MACCATALYST = 6, PLATFORM_IOSSIMULATOR = 7, PLATFORM_TVOSSIMULATOR = 8, - PLATFORM_WATCHOSSIMULATOR = 9 + PLATFORM_WATCHOSSIMULATOR = 9, + PLATFORM_DRIVERKIT = 10 }; // Values for tools enum in build_tool_version. diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h --- a/llvm/include/llvm/Object/MachO.h +++ b/llvm/include/llvm/Object/MachO.h @@ -615,6 +615,7 @@ case MachO::PLATFORM_IOSSIMULATOR: return "iossimulator"; case MachO::PLATFORM_TVOSSIMULATOR: return "tvossimulator"; case MachO::PLATFORM_WATCHOSSIMULATOR: return "watchossimulator"; + case MachO::PLATFORM_DRIVERKIT: return "driverkit"; default: std::string ret; raw_string_ostream ss(ret); diff --git a/llvm/include/llvm/TextAPI/MachO/Platform.h b/llvm/include/llvm/TextAPI/MachO/Platform.h --- a/llvm/include/llvm/TextAPI/MachO/Platform.h +++ b/llvm/include/llvm/TextAPI/MachO/Platform.h @@ -29,7 +29,8 @@ macCatalyst = MachO::PLATFORM_MACCATALYST, iOSSimulator = MachO::PLATFORM_IOSSIMULATOR, tvOSSimulator = MachO::PLATFORM_TVOSSIMULATOR, - watchOSSimulator = MachO::PLATFORM_WATCHOSSIMULATOR + watchOSSimulator = MachO::PLATFORM_WATCHOSSIMULATOR, + driverKit = MachO::PLATFORM_DRIVERKIT }; using PlatformSet = SmallSet; @@ -42,4 +43,4 @@ } // end namespace MachO. } // end namespace llvm. -#endif // LLVM_TEXTAPI_MACHO_PLATFORM_H \ No newline at end of file +#endif // LLVM_TEXTAPI_MACHO_PLATFORM_H diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -580,6 +580,7 @@ case MachO::PLATFORM_IOSSIMULATOR: return "iossimulator"; case MachO::PLATFORM_TVOSSIMULATOR: return "tvossimulator"; case MachO::PLATFORM_WATCHOSSIMULATOR: return "watchossimulator"; + case MachO::PLATFORM_DRIVERKIT: return "driverkit"; } llvm_unreachable("Invalid Mach-O platform type"); } diff --git a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp --- a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp +++ b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp @@ -1152,6 +1152,7 @@ case MachO::PLATFORM_IOSSIMULATOR: /* silence warning */ break; case MachO::PLATFORM_TVOSSIMULATOR: /* silence warning */ break; case MachO::PLATFORM_WATCHOSSIMULATOR: /* silence warning */ break; + case MachO::PLATFORM_DRIVERKIT: /* silence warning */ break; } llvm_unreachable("Invalid mach-o platform type"); } diff --git a/llvm/lib/TextAPI/MachO/Platform.cpp b/llvm/lib/TextAPI/MachO/Platform.cpp --- a/llvm/lib/TextAPI/MachO/Platform.cpp +++ b/llvm/lib/TextAPI/MachO/Platform.cpp @@ -83,6 +83,8 @@ return "tvOS Simulator"; case PlatformKind::watchOSSimulator: return "watchOS Simulator"; + case PlatformKind::driverKit: + return "DriverKit"; } llvm_unreachable("Unknown llvm.MachO.PlatformKind enum"); } diff --git a/llvm/lib/TextAPI/MachO/Target.cpp b/llvm/lib/TextAPI/MachO/Target.cpp --- a/llvm/lib/TextAPI/MachO/Target.cpp +++ b/llvm/lib/TextAPI/MachO/Target.cpp @@ -33,6 +33,7 @@ .Case("ios-simulator", PlatformKind::iOSSimulator) .Case("tvos-simulator", PlatformKind::tvOSSimulator) .Case("watchos-simulator", PlatformKind::watchOSSimulator) + .Case("driverkit", PlatformKind::driverKit) .Default(PlatformKind::unknown); if (Platform == PlatformKind::unknown) { diff --git a/llvm/lib/TextAPI/MachO/TextStub.cpp b/llvm/lib/TextAPI/MachO/TextStub.cpp --- a/llvm/lib/TextAPI/MachO/TextStub.cpp +++ b/llvm/lib/TextAPI/MachO/TextStub.cpp @@ -407,6 +407,9 @@ case PlatformKind::watchOSSimulator: OS << "watchos-simulator"; break; + case PlatformKind::driverKit: + OS << "driverkit"; + break; } } diff --git a/llvm/lib/TextAPI/MachO/TextStubCommon.cpp b/llvm/lib/TextAPI/MachO/TextStubCommon.cpp --- a/llvm/lib/TextAPI/MachO/TextStubCommon.cpp +++ b/llvm/lib/TextAPI/MachO/TextStubCommon.cpp @@ -84,6 +84,9 @@ case PlatformKind::macCatalyst: OS << "iosmac"; break; + case PlatformKind::driverKit: + OS << "driverkit"; + break; } }