aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/TextAPI/Target.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-09-02 21:17:18 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-12-08 17:34:50 +0000
commit06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e (patch)
tree62f873df87c7c675557a179e0c4c83fe9f3087bc /contrib/llvm-project/llvm/lib/TextAPI/Target.cpp
parentcf037972ea8863e2bab7461d77345367d2c1e054 (diff)
parent7fa27ce4a07f19b07799a767fc29416f3b625afb (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/TextAPI/Target.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/TextAPI/Target.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/contrib/llvm-project/llvm/lib/TextAPI/Target.cpp b/contrib/llvm-project/llvm/lib/TextAPI/Target.cpp
index c54c3bd66b9d..e20842498331 100644
--- a/contrib/llvm-project/llvm/lib/TextAPI/Target.cpp
+++ b/contrib/llvm-project/llvm/lib/TextAPI/Target.cpp
@@ -46,7 +46,10 @@ Expected<Target> Target::create(StringRef TargetValue) {
}
Target::operator std::string() const {
- return (getArchitectureName(Arch) + " (" + getPlatformName(Platform) + ")")
+ auto Version = MinDeployment.empty() ? "" : MinDeployment.getAsString();
+
+ return (getArchitectureName(Arch) + " (" + getPlatformName(Platform) +
+ Version + ")")
.str();
}
@@ -55,6 +58,13 @@ raw_ostream &operator<<(raw_ostream &OS, const Target &Target) {
return OS;
}
+PlatformVersionSet mapToPlatformVersionSet(ArrayRef<Target> Targets) {
+ PlatformVersionSet Result;
+ for (const auto &Target : Targets)
+ Result.insert({Target.Platform, Target.MinDeployment});
+ return Result;
+}
+
PlatformSet mapToPlatformSet(ArrayRef<Target> Targets) {
PlatformSet Result;
for (const auto &Target : Targets)
@@ -70,8 +80,11 @@ ArchitectureSet mapToArchitectureSet(ArrayRef<Target> Targets) {
}
std::string getTargetTripleName(const Target &Targ) {
+ auto Version =
+ Targ.MinDeployment.empty() ? "" : Targ.MinDeployment.getAsString();
+
return (getArchitectureName(Targ.Arch) + "-apple-" +
- getOSAndEnvironmentName(Targ.Platform))
+ getOSAndEnvironmentName(Targ.Platform, Version))
.str();
}