[Lldb-commits] [lldb] cec8263 - [Process] GetLanguageRuntimes() takes an argument that's always constant.
Davide Italiano via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 3 16:55:04 PST 2019
Author: Davide Italiano
Date: 2019-12-03T16:54:55-08:00
New Revision: cec82634a4034b1528940487349be14b0c405d2d
URL: https://github.com/llvm/llvm-project/commit/cec82634a4034b1528940487349be14b0c405d2d
DIFF: https://github.com/llvm/llvm-project/commit/cec82634a4034b1528940487349be14b0c405d2d.diff
LOG: [Process] GetLanguageRuntimes() takes an argument that's always constant.
And arguably `retry_if_null` isn't really descriptive of what
the flag did anyway.
Added:
Modified:
lldb/include/lldb/Target/Process.h
lldb/source/Target/Process.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 81181a831a49..47c5c7870405 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2185,11 +2185,9 @@ class Process : public std::enable_shared_from_this<Process>,
OperatingSystem *GetOperatingSystem() { return m_os_up.get(); }
- std::vector<LanguageRuntime *>
- GetLanguageRuntimes(bool retry_if_null = true);
+ std::vector<LanguageRuntime *> GetLanguageRuntimes();
- LanguageRuntime *GetLanguageRuntime(lldb::LanguageType language,
- bool retry_if_null = true);
+ LanguageRuntime *GetLanguageRuntime(lldb::LanguageType language);
bool IsPossibleDynamicValue(ValueObject &in_value);
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index ed0b951fbce1..a731a353c1bc 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -1486,8 +1486,7 @@ const lldb::ABISP &Process::GetABI() {
return m_abi_sp;
}
-std::vector<LanguageRuntime *>
-Process::GetLanguageRuntimes(bool retry_if_null) {
+std::vector<LanguageRuntime *> Process::GetLanguageRuntimes() {
std::vector<LanguageRuntime *> language_runtimes;
if (m_finalizing)
@@ -1500,15 +1499,14 @@ Process::GetLanguageRuntimes(bool retry_if_null) {
// yet or the proper condition for loading wasn't yet met (e.g. libc++.so
// hadn't been loaded).
for (const lldb::LanguageType lang_type : Language::GetSupportedLanguages()) {
- if (LanguageRuntime *runtime = GetLanguageRuntime(lang_type, retry_if_null))
+ if (LanguageRuntime *runtime = GetLanguageRuntime(lang_type))
language_runtimes.emplace_back(runtime);
}
return language_runtimes;
}
-LanguageRuntime *Process::GetLanguageRuntime(lldb::LanguageType language,
- bool retry_if_null) {
+LanguageRuntime *Process::GetLanguageRuntime(lldb::LanguageType language) {
if (m_finalizing)
return nullptr;
@@ -1517,7 +1515,7 @@ LanguageRuntime *Process::GetLanguageRuntime(lldb::LanguageType language,
std::lock_guard<std::recursive_mutex> guard(m_language_runtimes_mutex);
LanguageRuntimeCollection::iterator pos;
pos = m_language_runtimes.find(language);
- if (pos == m_language_runtimes.end() || (retry_if_null && !pos->second)) {
+ if (pos == m_language_runtimes.end() || !pos->second) {
lldb::LanguageRuntimeSP runtime_sp(
LanguageRuntime::FindPlugin(this, language));
More information about the lldb-commits
mailing list