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/ValueObjectCast.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/ValueObjectCast.cpp')
-rw-r--r-- | lldb/source/Core/ValueObjectCast.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lldb/source/Core/ValueObjectCast.cpp b/lldb/source/Core/ValueObjectCast.cpp index e1c94cc5fa4..4f4f8cc681d 100644 --- a/lldb/source/Core/ValueObjectCast.cpp +++ b/lldb/source/Core/ValueObjectCast.cpp @@ -54,35 +54,30 @@ ValueObjectCast::ValueObjectCast m_cast_type (cast_type) { SetName (name); - m_value.SetContext (Value::eContextTypeClangType, cast_type.GetOpaqueQualType()); + //m_value.SetContext (Value::eContextTypeClangType, cast_type.GetOpaqueQualType()); + m_value.SetClangType (cast_type); } ValueObjectCast::~ValueObjectCast() { } -lldb::clang_type_t +ClangASTType ValueObjectCast::GetClangTypeImpl () { - return m_cast_type.GetOpaqueQualType(); + return m_cast_type; } size_t ValueObjectCast::CalculateNumChildren() { - return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true); -} - -clang::ASTContext * -ValueObjectCast::GetClangASTImpl () -{ - return m_cast_type.GetASTContext(); + return GetClangType().GetNumChildren (true); } uint64_t ValueObjectCast::GetByteSize() { - return m_value.GetValueByteSize(GetClangAST(), NULL); + return m_value.GetValueByteSize(NULL); } lldb::ValueType @@ -103,9 +98,11 @@ ValueObjectCast::UpdateValue () Value old_value(m_value); m_update_point.SetUpdated(); m_value = m_parent->GetValue(); - m_value.SetContext (Value::eContextTypeClangType, GetClangType()); + ClangASTType clang_type (GetClangType()); + //m_value.SetContext (Value::eContextTypeClangType, clang_type); + m_value.SetClangType (clang_type); SetAddressTypeOfChildren(m_parent->GetAddressTypeOfChildren()); - if (ClangASTContext::IsAggregateType (GetClangType())) + if (clang_type.IsAggregateType ()) { // this value object represents an aggregate type whose // children have values, but this object does not. So we @@ -113,7 +110,7 @@ ValueObjectCast::UpdateValue () SetValueDidChange (m_value.GetValueType() != old_value.GetValueType() || m_value.GetScalar() != old_value.GetScalar()); } ExecutionContext exe_ctx (GetExecutionContextRef()); - 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()); SetValueDidChange (m_parent->GetValueDidChange()); return true; } |