diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:03:47 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:04:23 +0000 |
commit | 7fa27ce4a07f19b07799a767fc29416f3b625afb (patch) | |
tree | 27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/lib/TextAPI/Target.cpp | |
parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) |
Diffstat (limited to 'llvm/lib/TextAPI/Target.cpp')
-rw-r--r-- | llvm/lib/TextAPI/Target.cpp | 17 |
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(); } |