aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TextAPI/Target.cpp')
-rw-r--r--llvm/lib/TextAPI/Target.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/lib/TextAPI/Target.cpp b/llvm/lib/TextAPI/Target.cpp
index c54c3bd66b9d..e20842498331 100644
--- a/llvm/lib/TextAPI/Target.cpp
+++ b/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();
}