From 5368ebc87be3548597daca304164ef0c7fe38f98 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 18 Jun 2018 15:02:23 +0000 Subject: Use llvm::VersionTuple instead of manual version marshalling Summary: This has multiple advantages: - we need only one function argument/instance variable instead of three - no need to default initialize variables - no custom parsing code - VersionTuple has comparison operators, which makes version comparisons much simpler Reviewers: zturner, friss, clayborg, jingham Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D47889 --- .../LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/LanguageRuntime') diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 5516cf90122..fef42c78b24 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -293,16 +293,14 @@ bool AppleObjCRuntime::AppleIsModuleObjCLibrary(const ModuleSP &module_sp) { uint32_t AppleObjCRuntime::GetFoundationVersion() { if (!m_Foundation_major.hasValue()) { const ModuleList &modules = m_process->GetTarget().GetImages(); - uint32_t major = UINT32_MAX; for (uint32_t idx = 0; idx < modules.GetSize(); idx++) { lldb::ModuleSP module_sp = modules.GetModuleAtIndex(idx); if (!module_sp) continue; if (strcmp(module_sp->GetFileSpec().GetFilename().AsCString(""), "Foundation") == 0) { - module_sp->GetVersion(&major, 1); - m_Foundation_major = major; - return major; + m_Foundation_major = module_sp->GetVersion().getMajor(); + return *m_Foundation_major; } } return LLDB_INVALID_MODULE_VERSION; -- cgit v1.2.3