From 1be10fca5f2b290b956710d9c03c14b0c82f7ef4 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 29 Sep 2010 01:12:09 +0000 Subject: Fixed the forward declaration issue that was present in the DWARF parser after adding methods to C++ and objective C classes. In order to make methods, we need the function prototype which means we need the arguments. Parsing these could cause a circular reference that caused an assertion. Added a new typedef for the clang opaque types which are just void pointers: lldb::clang_type_t. This appears in lldb-types.h. This was fixed by enabling struct, union, class, and enum types to only get a forward declaration when we make the clang opaque qual type for these types. When they need to actually be resolved, lldb_private::Type will call a new function in the SymbolFile protocol to resolve a clang type when it is not fully defined (clang::TagDecl::getDefinition() returns NULL). This allows us to be a lot more lazy when parsing clang types and keeps down the amount of data that gets parsed into the ASTContext for each module. Getting the clang type from a "lldb_private::Type" object now takes a boolean that indicates if a forward declaration is ok: clang_type_t lldb_private::Type::GetClangType (bool forward_decl_is_ok); So function prototypes that define parameters that are "const T&" can now just parse the forward declaration for type 'T' and we avoid circular references in the type system. llvm-svn: 115012 --- lldb/source/Core/ValueObjectChild.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Core/ValueObjectChild.cpp') diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp index 73af56c07d2..03986822f51 100644 --- a/lldb/source/Core/ValueObjectChild.cpp +++ b/lldb/source/Core/ValueObjectChild.cpp @@ -52,7 +52,7 @@ ValueObjectChild::~ValueObjectChild() } void * -ValueObjectChild::GetOpaqueClangQualType() +ValueObjectChild::GetClangType() { return m_clang_type; } @@ -104,7 +104,7 @@ ValueObjectChild::GetTypeName() { if (m_type_name.IsEmpty()) { - m_type_name = ClangASTType::GetClangTypeName (GetOpaqueClangQualType()); + m_type_name = ClangASTType::GetClangTypeName (GetClangType()); if (m_type_name) { if (m_bitfield_bit_size > 0) @@ -139,13 +139,13 @@ ValueObjectChild::UpdateValue (ExecutionContextScope *exe_scope) Value::ValueType value_type = parent->GetValue().GetValueType(); m_value.SetValueType (value_type); - if (ClangASTContext::IsPointerOrReferenceType (parent->GetOpaqueClangQualType())) + if (ClangASTContext::IsPointerOrReferenceType (parent->GetClangType())) { uint32_t offset = 0; m_value.GetScalar() = parent->GetDataExtractor().GetPointer(&offset); // For pointers, m_byte_offset should only ever be set if we // ValueObject::GetSyntheticArrayMemberFromPointer() was called - if (ClangASTContext::IsPointerType (parent->GetOpaqueClangQualType()) && m_byte_offset) + if (ClangASTContext::IsPointerType (parent->GetClangType()) && m_byte_offset) m_value.GetScalar() += m_byte_offset; if (value_type == Value::eValueTypeScalar || value_type == Value::eValueTypeFileAddress) -- cgit v1.2.3