summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObjectChild.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-07-11 22:46:58 +0000
committerGreg Clayton <gclayton@apple.com>2013-07-11 22:46:58 +0000
commit57ee306789ba68992d537a65b3f107eadd18db2d (patch)
tree2d07b653b2b2dd7dc716b0119b16842861ee9eff /lldb/source/Core/ValueObjectChild.cpp
parent37002ad30e7ccee79362e39e0a24c33f87efa993 (diff)
downloadbcm5719-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/ValueObjectChild.cpp')
-rw-r--r--lldb/source/Core/ValueObjectChild.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp
index cf69ea5da68..23add1ccf0e 100644
--- a/lldb/source/Core/ValueObjectChild.cpp
+++ b/lldb/source/Core/ValueObjectChild.cpp
@@ -27,8 +27,7 @@ using namespace lldb_private;
ValueObjectChild::ValueObjectChild
(
ValueObject &parent,
- clang::ASTContext *clang_ast,
- void *clang_type,
+ const ClangASTType &clang_type,
const ConstString &name,
uint64_t byte_size,
int32_t byte_offset,
@@ -39,7 +38,6 @@ ValueObjectChild::ValueObjectChild
AddressType child_ptr_or_ref_addr_type
) :
ValueObject (parent),
- m_clang_ast (clang_ast),
m_clang_type (clang_type),
m_byte_size (byte_size),
m_byte_offset (byte_offset),
@@ -65,7 +63,7 @@ ValueObjectChild::GetValueType() const
size_t
ValueObjectChild::CalculateNumChildren()
{
- return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true);
+ return GetClangType().GetNumChildren (true);
}
ConstString
@@ -73,7 +71,7 @@ ValueObjectChild::GetTypeName()
{
if (m_type_name.IsEmpty())
{
- m_type_name = ClangASTType::GetConstTypeName (GetClangAST(), GetClangType());
+ m_type_name = GetClangType().GetConstTypeName ();
if (m_type_name)
{
if (m_bitfield_bit_size > 0)
@@ -94,7 +92,7 @@ ValueObjectChild::GetTypeName()
ConstString
ValueObjectChild::GetQualifiedTypeName()
{
- ConstString qualified_name = ClangASTType::GetConstQualifiedTypeName (GetClangAST(), GetClangType());
+ ConstString qualified_name = GetClangType().GetConstTypeName();
if (qualified_name)
{
if (m_bitfield_bit_size > 0)
@@ -121,14 +119,14 @@ ValueObjectChild::UpdateValue ()
{
if (parent->UpdateValueIfNeeded(false))
{
- m_value.SetContext(Value::eContextTypeClangType, GetClangType());
+ m_value.SetClangType(GetClangType());
// Copy the parent scalar value and the scalar value type
m_value.GetScalar() = parent->GetValue().GetScalar();
Value::ValueType value_type = parent->GetValue().GetValueType();
m_value.SetValueType (value_type);
- if (ClangASTContext::IsPointerOrReferenceType (parent->GetClangType()))
+ if (parent->GetClangType().IsPointerOrReferenceType ())
{
lldb::addr_t addr = parent->GetPointerValue ();
m_value.GetScalar() = addr;
@@ -209,7 +207,7 @@ ValueObjectChild::UpdateValue ()
if (m_error.Success())
{
ExecutionContext exe_ctx (GetExecutionContextRef().Lock());
- 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());
}
}
else
OpenPOWER on IntegriCloud