diff options
| author | Alex Langford <apl@fb.com> | 2019-07-01 20:36:33 +0000 |
|---|---|---|
| committer | Alex Langford <apl@fb.com> | 2019-07-01 20:36:33 +0000 |
| commit | d7fcee62f114c5f96bc0d8430af40ce198231daa (patch) | |
| tree | 6bb67a6dc4685ba36a5e0c89b24f78af3be8be9e /lldb/source/Core | |
| parent | 975120a21b43a192e9475de4af7dcd6565b37224 (diff) | |
| download | bcm5719-llvm-d7fcee62f114c5f96bc0d8430af40ce198231daa.tar.gz bcm5719-llvm-d7fcee62f114c5f96bc0d8430af40ce198231daa.zip | |
[Core] Generalize ValueObject::IsRuntimeSupportValue
Summary:
Instead of falling back to ObjCLanguageRuntime, we should be falling
back to every loaded language runtime. This makes ValueObject more
language agnostic.
Reviewers: labath, compnerd, JDevlieghere, davide
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D63240
llvm-svn: 364845
Diffstat (limited to 'lldb/source/Core')
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 409f3d6b13f..73cd1339433 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1695,18 +1695,28 @@ bool ValueObject::IsPossibleDynamicType() { bool ValueObject::IsRuntimeSupportValue() { Process *process(GetProcessSP().get()); - if (process) { - LanguageRuntime *runtime = - process->GetLanguageRuntime(GetObjectRuntimeLanguage()); - if (!runtime) - runtime = ObjCLanguageRuntime::Get(*process); - if (runtime) - return runtime->IsRuntimeSupportValue(*this); - // If there is no language runtime, trust the compiler to mark all - // runtime support variables as artificial. - return GetVariable() && GetVariable()->IsArtificial(); + if (!process) + return false; + + // We trust the the compiler did the right thing and marked runtime support + // values as artificial. + if (!GetVariable() || !GetVariable()->IsArtificial()) + return false; + + LanguageType lang = eLanguageTypeUnknown; + if (auto *sym_ctx_scope = GetSymbolContextScope()) { + if (auto *func = sym_ctx_scope->CalculateSymbolContextFunction()) + lang = func->GetLanguage(); + else if (auto *comp_unit = + sym_ctx_scope->CalculateSymbolContextCompileUnit()) + lang = comp_unit->GetLanguage(); } - return false; + + if (auto *runtime = process->GetLanguageRuntime(lang)) + if (runtime->IsWhitelistedRuntimeValue(GetName())) + return false; + + return true; } bool ValueObject::IsNilReference() { |

