diff options
author | Greg Clayton <gclayton@apple.com> | 2013-07-11 22:46:58 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-07-11 22:46:58 +0000 |
commit | 57ee306789ba68992d537a65b3f107eadd18db2d (patch) | |
tree | 2d07b653b2b2dd7dc716b0119b16842861ee9eff /lldb/source/Core/ValueObjectMemory.cpp | |
parent | 37002ad30e7ccee79362e39e0a24c33f87efa993 (diff) | |
download | bcm5719-llvm-57ee306789ba68992d537a65b3f107eadd18db2d.tar.gz bcm5719-llvm-57ee306789ba68992d537a65b3f107eadd18db2d.zip |
Huge change to clean up types.
A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.
This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.
llvm-svn: 186130
Diffstat (limited to 'lldb/source/Core/ValueObjectMemory.cpp')
-rw-r--r-- | lldb/source/Core/ValueObjectMemory.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/lldb/source/Core/ValueObjectMemory.cpp b/lldb/source/Core/ValueObjectMemory.cpp index 2bdf44f9c2d..42fd0e8fffb 100644 --- a/lldb/source/Core/ValueObjectMemory.cpp +++ b/lldb/source/Core/ValueObjectMemory.cpp @@ -103,7 +103,8 @@ ValueObjectMemory::ValueObjectMemory (ExecutionContextScope *exe_scope, TargetSP target_sp (GetTargetSP()); SetName (ConstString(name)); - m_value.SetContext(Value::eContextTypeClangType, m_clang_type.GetOpaqueQualType()); +// m_value.SetContext(Value::eContextTypeClangType, m_clang_type.GetOpaqueQualType()); + m_value.SetClangType(m_clang_type); lldb::addr_t load_address = m_address.GetLoadAddress (target_sp.get()); if (load_address != LLDB_INVALID_ADDRESS) { @@ -130,12 +131,12 @@ ValueObjectMemory::~ValueObjectMemory() { } -lldb::clang_type_t +ClangASTType ValueObjectMemory::GetClangTypeImpl () { if (m_type_sp) return m_type_sp->GetClangForwardType(); - return m_clang_type.GetOpaqueQualType(); + return m_clang_type; } ConstString @@ -143,7 +144,7 @@ ValueObjectMemory::GetTypeName() { if (m_type_sp) return m_type_sp->GetName(); - return ClangASTType::GetConstTypeName (GetClangAST(), m_clang_type.GetOpaqueQualType()); + return m_clang_type.GetConstTypeName(); } size_t @@ -152,17 +153,7 @@ ValueObjectMemory::CalculateNumChildren() if (m_type_sp) return m_type_sp->GetNumChildren(true); const bool omit_empty_base_classes = true; - return ClangASTContext::GetNumChildren (m_clang_type.GetASTContext(), - m_clang_type.GetOpaqueQualType(), - omit_empty_base_classes); -} - -clang::ASTContext * -ValueObjectMemory::GetClangASTImpl () -{ - if (m_type_sp) - return m_type_sp->GetClangAST(); - return m_clang_type.GetASTContext(); + return m_clang_type.GetNumChildren (omit_empty_base_classes); } uint64_t @@ -170,7 +161,7 @@ ValueObjectMemory::GetByteSize() { if (m_type_sp) return m_type_sp->GetByteSize(); - return m_clang_type.GetClangTypeByteSize (); + return m_clang_type.GetByteSize (); } lldb::ValueType @@ -209,7 +200,7 @@ ValueObjectMemory::UpdateValue () case Value::eValueTypeScalar: // The variable value is in the Scalar value inside the m_value. // We can point our m_data right to it. - m_error = m_value.GetValueAsData (&exe_ctx, GetClangAST(), m_data, 0, GetModule().get()); + m_error = m_value.GetValueAsData (&exe_ctx, m_data, 0, GetModule().get()); break; case Value::eValueTypeFileAddress: @@ -234,7 +225,7 @@ ValueObjectMemory::UpdateValue () } } - if (ClangASTContext::IsAggregateType (GetClangType())) + if (GetClangType().IsAggregateType()) { // this value object represents an aggregate type whose // children have values, but this object does not. So we @@ -249,9 +240,12 @@ ValueObjectMemory::UpdateValue () if (m_type_sp) value.SetContext(Value::eContextTypeLLDBType, m_type_sp.get()); else - value.SetContext(Value::eContextTypeClangType, m_clang_type.GetOpaqueQualType()); + { + //value.SetContext(Value::eContextTypeClangType, m_clang_type.GetOpaqueQualType()); + value.SetClangType(m_clang_type); + } - m_error = value.GetValueAsData(&exe_ctx, GetClangAST(), m_data, 0, GetModule().get()); + m_error = value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get()); } break; } |