summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-06-18 15:02:23 +0000
committerPavel Labath <labath@google.com>2018-06-18 15:02:23 +0000
commit2272c4811f8d2c56612d483c2546f053e7ea61cc (patch)
treec591a7a541563c323f1b4f8697a8cd7b8ea53f8c /lldb/source/Core/Module.cpp
parent13684d840019282ed720cd52a9a0e6c3485d3a76 (diff)
downloadbcm5719-llvm-2272c4811f8d2c56612d483c2546f053e7ea61cc.tar.gz
bcm5719-llvm-2272c4811f8d2c56612d483c2546f053e7ea61cc.zip
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 llvm-svn: 334950
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 6ffcd787ec8..3b1a4fd7be0 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1640,16 +1640,10 @@ bool Module::RemapSourceFile(llvm::StringRef path,
return m_source_mappings.RemapPath(path, new_path);
}
-uint32_t Module::GetVersion(uint32_t *versions, uint32_t num_versions) {
- ObjectFile *obj_file = GetObjectFile();
- if (obj_file)
- return obj_file->GetVersion(versions, num_versions);
-
- if (versions != nullptr && num_versions != 0) {
- for (uint32_t i = 0; i < num_versions; ++i)
- versions[i] = LLDB_INVALID_MODULE_VERSION;
- }
- return 0;
+llvm::VersionTuple Module::GetVersion() {
+ if (ObjectFile *obj_file = GetObjectFile())
+ return obj_file->GetVersion();
+ return llvm::VersionTuple();
}
bool Module::GetIsDynamicLinkEditor() {
OpenPOWER on IntegriCloud