diff options
author | Sam Powell <sam@sampowell.dev> | 2021-06-09 21:13:31 -0700 |
---|---|---|
committer | Cyndy Ishida <cyndy_ishida@apple.com> | 2021-06-09 21:17:34 -0700 |
commit | 5b5ab80e31958b3b4a52de13ce4306a2c6c8765d (patch) | |
tree | f080cb96a44ede65df1c40ef6102988ef4fcb76d /llvm/lib/TextAPI/Platform.cpp | |
parent | 5fc2673fbce247e107094b28c22cbb2d5f1691a8 (diff) | |
download | llvm-5b5ab80e31958b3b4a52de13ce4306a2c6c8765d.zip llvm-5b5ab80e31958b3b4a52de13ce4306a2c6c8765d.tar.gz llvm-5b5ab80e31958b3b4a52de13ce4306a2c6c8765d.tar.bz2 |
Reland "[llvm] llvm-tapi-diff"
This is relanding commit d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096 .
This patch additionally addresses failures found in buildbots due to unstable build ordering & post review comments.
This patch introduces a new tool, llvm-tapi-diff, that compares and returns the diff of two TBD files.
Reviewed By: ributzka, JDevlieghere
Differential Revision: https://reviews.llvm.org/D101835
Diffstat (limited to 'llvm/lib/TextAPI/Platform.cpp')
-rw-r--r-- | llvm/lib/TextAPI/Platform.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/lib/TextAPI/Platform.cpp b/llvm/lib/TextAPI/Platform.cpp index 038ad9d..a2ce6d0 100644 --- a/llvm/lib/TextAPI/Platform.cpp +++ b/llvm/lib/TextAPI/Platform.cpp @@ -105,5 +105,34 @@ PlatformKind getPlatformFromName(StringRef Name) { .Default(PlatformKind::unknown); } +std::string getOSAndEnvironmentName(PlatformKind Platform, + std::string Version) { + switch (Platform) { + case PlatformKind::unknown: + return "darwin" + Version; + case PlatformKind::macOS: + return "macos" + Version; + case PlatformKind::iOS: + return "ios" + Version; + case PlatformKind::tvOS: + return "tvos" + Version; + case PlatformKind::watchOS: + return "watchos" + Version; + case PlatformKind::bridgeOS: + return "bridgeos" + Version; + case PlatformKind::macCatalyst: + return "ios" + Version + "-macabi"; + case PlatformKind::iOSSimulator: + return "ios" + Version + "-simulator"; + case PlatformKind::tvOSSimulator: + return "tvos" + Version + "-simulator"; + case PlatformKind::watchOSSimulator: + return "watchos" + Version + "-simulator"; + case PlatformKind::driverKit: + return "driverkit" + Version; + } + llvm_unreachable("Unknown llvm::MachO::PlatformKind enum"); +} + } // end namespace MachO. } // end namespace llvm. |