summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangFunction.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-09-29 01:12:09 +0000
committerGreg Clayton <gclayton@apple.com>2010-09-29 01:12:09 +0000
commit1be10fca5f2b290b956710d9c03c14b0c82f7ef4 (patch)
tree4036af6f55e00076d5e2a9ee849bbcf628a39277 /lldb/source/Expression/ClangFunction.cpp
parentedd4b600f3016b1ef1c3e39c3f495c524f600fa5 (diff)
downloadbcm5719-llvm-1be10fca5f2b290b956710d9c03c14b0c82f7ef4.tar.gz
bcm5719-llvm-1be10fca5f2b290b956710d9c03c14b0c82f7ef4.zip
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
Diffstat (limited to 'lldb/source/Expression/ClangFunction.cpp')
-rw-r--r--lldb/source/Expression/ClangFunction.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp
index 4035479cc82..aaff16dbb6f 100644
--- a/lldb/source/Expression/ClangFunction.cpp
+++ b/lldb/source/Expression/ClangFunction.cpp
@@ -83,7 +83,7 @@ ClangFunction::ClangFunction(const char *target_triple,
m_JITted (false)
{
m_function_addr = m_function_ptr->GetAddressRange().GetBaseAddress();
- m_function_return_qual_type = m_function_ptr->GetReturnType().GetOpaqueClangQualType();
+ m_function_return_qual_type = m_function_ptr->GetReturnType().GetClangType();
}
//----------------------------------------------------------------------
@@ -153,7 +153,7 @@ ClangFunction::CompileFunction (Stream &errors)
else
{
Value *arg_value = m_arg_values.GetValueAtIndex(i);
- void *clang_qual_type = arg_value->GetOpaqueClangQualType ();
+ void *clang_qual_type = arg_value->GetClangType ();
if (clang_qual_type != NULL)
{
type_stdstr = ClangASTContext::GetTypeName(clang_qual_type);
@@ -322,7 +322,7 @@ ClangFunction::WriteFunctionArguments (ExecutionContext &exe_ctx,
if (arg_value->GetValueType() == Value::eValueTypeHostAddress &&
arg_value->GetContextType() == Value::eContextTypeOpaqueClangQualType &&
- ClangASTContext::IsPointerType(arg_value->GetOpaqueClangQualType()))
+ ClangASTContext::IsPointerType(arg_value->GetClangType()))
continue;
const Scalar &arg_scalar = arg_value->ResolveValue(&exe_ctx, m_clang_ast_context->getASTContext());
OpenPOWER on IntegriCloud