aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/Platform.cpp
diff options
context:
space:
mode:
authorSam Powell <sam@sampowell.dev>2021-06-03 11:11:23 -0700
committerCyndy Ishida <cyndy_ishida@apple.com>2021-06-03 11:38:00 -0700
commitd1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096 (patch)
tree159b889e441d384ce9d7ae385c5d8752c262596d /llvm/lib/TextAPI/Platform.cpp
parent44cdf771fe12ca528403cec9e6a8438b5107133b (diff)
downloadllvm-d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096.zip
llvm-d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096.tar.gz
llvm-d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096.tar.bz2
[llvm] llvm-tapi-diff
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.cpp29
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.