diff options
Diffstat (limited to 'llvm/lib/TextAPI')
-rw-r--r-- | llvm/lib/TextAPI/Platform.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/TextAPI/TextStubV5.cpp | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/TextAPI/Platform.cpp b/llvm/lib/TextAPI/Platform.cpp index 673fcb7..a432462 100644 --- a/llvm/lib/TextAPI/Platform.cpp +++ b/llvm/lib/TextAPI/Platform.cpp @@ -132,5 +132,12 @@ std::string getOSAndEnvironmentName(PlatformType Platform, llvm_unreachable("Unknown llvm::MachO::PlatformType enum"); } +VersionTuple mapToSupportedOSVersion(const Triple &Triple) { + const VersionTuple MinSupportedOS = Triple.getMinimumSupportedOSVersion(); + if (MinSupportedOS > Triple.getOSVersion()) + return MinSupportedOS; + return Triple.getOSVersion(); +} + } // end namespace MachO. } // end namespace llvm. diff --git a/llvm/lib/TextAPI/TextStubV5.cpp b/llvm/lib/TextAPI/TextStubV5.cpp index a9355fab..ade4c86 100644 --- a/llvm/lib/TextAPI/TextStubV5.cpp +++ b/llvm/lib/TextAPI/TextStubV5.cpp @@ -293,8 +293,10 @@ Expected<TargetList> getTargetsSection(const Object *Section) { if (!TargetOrErr) return make_error<JSONStubError>(getParseErrorMsg(TBDKey::Target)); TargetOrErr->MinDeployment = Version; - - IFTargets.push_back(*TargetOrErr); + // Convert to LLVM::Triple to accurately compute minOS + platform + arch + // pairing. + IFTargets.push_back( + MachO::Target(Triple(getTargetTripleName(*TargetOrErr)))); } return std::move(IFTargets); } |