diff options
Diffstat (limited to 'lldb/source/Plugins')
17 files changed, 403 insertions, 490 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp index bc63e591cc2..4685c3e759e 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp @@ -318,8 +318,6 @@ ABIMacOSX_arm::GetArgumentValues (Thread &thread, // For now, assume that the types in the AST values come from the Target's // scratch AST. - clang::ASTContext *ast_context = exe_ctx.GetTargetRef().GetScratchClangASTContext()->getASTContext(); - // Extract the register context so we can read arguments from registers RegisterContext *reg_ctx = thread.GetRegisterContext().get(); @@ -338,18 +336,18 @@ ABIMacOSX_arm::GetArgumentValues (Thread &thread, if (!value) return false; - void *value_type = value->GetClangType(); - if (value_type) + ClangASTType clang_type = value->GetClangType(); + if (clang_type) { bool is_signed = false; size_t bit_width = 0; - if (ClangASTContext::IsIntegerType (value_type, is_signed)) + if (clang_type.IsIntegerType (is_signed)) { - bit_width = ClangASTType::GetClangTypeBitWidth(ast_context, value_type); + bit_width = clang_type.GetBitSize(); } - else if (ClangASTContext::IsPointerOrReferenceType (value_type)) + else if (clang_type.IsPointerOrReferenceType ()) { - bit_width = ClangASTType::GetClangTypeBitWidth(ast_context, value_type); + bit_width = clang_type.GetBitSize(); } else { @@ -421,20 +419,20 @@ ABIMacOSX_arm::GetArgumentValues (Thread &thread, ValueObjectSP ABIMacOSX_arm::GetReturnValueObjectImpl (Thread &thread, - lldb_private::ClangASTType &ast_type) const + lldb_private::ClangASTType &clang_type) const { Value value; ValueObjectSP return_valobj_sp; - void *value_type = ast_type.GetOpaqueQualType(); - if (!value_type) + if (!clang_type) return return_valobj_sp; - clang::ASTContext *ast_context = ast_type.GetASTContext(); + clang::ASTContext *ast_context = clang_type.GetASTContext(); if (!ast_context) return return_valobj_sp; - value.SetContext (Value::eContextTypeClangType, value_type); + //value.SetContext (Value::eContextTypeClangType, clang_type.GetOpaqueQualType()); + value.SetClangType (clang_type); RegisterContext *reg_ctx = thread.GetRegisterContext().get(); if (!reg_ctx) @@ -446,9 +444,9 @@ ABIMacOSX_arm::GetReturnValueObjectImpl (Thread &thread, // when reading data const RegisterInfo *r0_reg_info = reg_ctx->GetRegisterInfoByName("r0", 0); - if (ClangASTContext::IsIntegerType (value_type, is_signed)) + if (clang_type.IsIntegerType (is_signed)) { - size_t bit_width = ClangASTType::GetClangTypeBitWidth(ast_context, value_type); + size_t bit_width = clang_type.GetBitSize(); switch (bit_width) { @@ -486,7 +484,7 @@ ABIMacOSX_arm::GetReturnValueObjectImpl (Thread &thread, break; } } - else if (ClangASTContext::IsPointerType (value_type)) + else if (clang_type.IsPointerType ()) { uint32_t ptr = thread.GetRegisterContext()->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX; value.GetScalar() = ptr; @@ -499,11 +497,9 @@ ABIMacOSX_arm::GetReturnValueObjectImpl (Thread &thread, // If we get here, we have a valid Value, so make our ValueObject out of it: - return_valobj_sp = ValueObjectConstResult::Create( - thread.GetStackFrameAtIndex(0).get(), - ast_type.GetASTContext(), - value, - ConstString("")); + return_valobj_sp = ValueObjectConstResult::Create(thread.GetStackFrameAtIndex(0).get(), + value, + ConstString("")); return return_valobj_sp; } @@ -517,19 +513,13 @@ ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj return error; } - clang_type_t value_type = new_value_sp->GetClangType(); - if (!value_type) + ClangASTType clang_type = new_value_sp->GetClangType(); + if (!clang_type) { error.SetErrorString ("Null clang type for return value."); return error; } - clang::ASTContext *ast_context = new_value_sp->GetClangAST(); - if (!ast_context) - { - error.SetErrorString ("Null clang AST for return value."); - return error; - } Thread *thread = frame_sp->GetThread().get(); bool is_signed; @@ -539,7 +529,7 @@ ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj RegisterContext *reg_ctx = thread->GetRegisterContext().get(); bool set_it_simple = false; - if (ClangASTContext::IsIntegerType (value_type, is_signed) || ClangASTContext::IsPointerType(value_type)) + if (clang_type.IsIntegerType (is_signed) || clang_type.IsPointerType()) { DataExtractor data; size_t num_bytes = new_value_sp->GetData(data); @@ -573,7 +563,7 @@ ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj error.SetErrorString("We don't support returning longer than 64 bit integer values at present."); } } - else if (ClangASTContext::IsFloatingPointType (value_type, count, is_complex)) + else if (clang_type.IsFloatingPointType (count, is_complex)) { if (is_complex) error.SetErrorString ("We don't support returning complex values at present"); diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp index d2126bf3556..deb531d937a 100644 --- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp @@ -510,16 +510,12 @@ ABIMacOSX_i386::PrepareNormalCall (Thread &thread, } break; case Value::eValueTypeHostAddress: - switch (val->GetContextType()) { - default: - return false; - case Value::eContextTypeClangType: + ClangASTType clang_type (val->GetClangType()); + if (clang_type) { - void *val_type = val->GetClangType(); - uint32_t cstr_length; - - if (ClangASTContext::IsCStringType (val_type, cstr_length)) + uint32_t cstr_length = 0; + if (clang_type.IsCStringType (cstr_length)) { const char *cstr = (const char*)val->GetScalar().ULongLong(); cstr_length = strlen(cstr); @@ -616,11 +612,6 @@ ABIMacOSX_i386::GetArgumentValues (Thread &thread, unsigned int num_values = values.GetSize(); unsigned int value_index; - // Extract the Clang AST context from the PC so that we can figure out type - // sizes - - clang::ASTContext *ast_context = thread.CalculateTarget()->GetScratchClangASTContext()->getASTContext(); - // Get the pointer to the first stack argument so we have a place to start // when reading data @@ -647,35 +638,27 @@ ABIMacOSX_i386::GetArgumentValues (Thread &thread, // We currently only support extracting values with Clang QualTypes. // Do we care about others? - switch (value->GetContextType()) + ClangASTType clang_type (value->GetClangType()); + if (clang_type) { - default: - return false; - case Value::eContextTypeClangType: - { - void *value_type = value->GetClangType(); - bool is_signed; - - if (ClangASTContext::IsIntegerType (value_type, is_signed)) - { - size_t bit_width = ClangASTType::GetClangTypeBitWidth(ast_context, value_type); - - ReadIntegerArgument(value->GetScalar(), - bit_width, - is_signed, - thread.GetProcess().get(), - current_stack_argument); - } - else if (ClangASTContext::IsPointerType (value_type)) - { - ReadIntegerArgument(value->GetScalar(), - 32, - false, - thread.GetProcess().get(), - current_stack_argument); - } - } - break; + bool is_signed; + + if (clang_type.IsIntegerType (is_signed)) + { + ReadIntegerArgument(value->GetScalar(), + clang_type.GetBitSize(), + is_signed, + thread.GetProcess().get(), + current_stack_argument); + } + else if (clang_type.IsPointerType()) + { + ReadIntegerArgument(value->GetScalar(), + clang_type.GetBitSize(), + false, + thread.GetProcess().get(), + current_stack_argument); + } } } @@ -692,19 +675,13 @@ ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb return error; } - clang_type_t value_type = new_value_sp->GetClangType(); - if (!value_type) + ClangASTType clang_type = new_value_sp->GetClangType(); + if (!clang_type) { error.SetErrorString ("Null clang type for return value."); return error; } - clang::ASTContext *ast_context = new_value_sp->GetClangAST(); - if (!ast_context) - { - error.SetErrorString ("Null clang AST for return value."); - return error; - } Thread *thread = frame_sp->GetThread().get(); bool is_signed; @@ -714,7 +691,7 @@ ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb RegisterContext *reg_ctx = thread->GetRegisterContext().get(); bool set_it_simple = false; - if (ClangASTContext::IsIntegerType (value_type, is_signed) || ClangASTContext::IsPointerType(value_type)) + if (clang_type.IsIntegerType (is_signed) || clang_type.IsPointerType()) { DataExtractor data; size_t num_bytes = new_value_sp->GetData(data); @@ -748,7 +725,7 @@ ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb error.SetErrorString("We don't support returning longer than 64 bit integer values at present."); } } - else if (ClangASTContext::IsFloatingPointType (value_type, count, is_complex)) + else if (clang_type.IsFloatingPointType (count, is_complex)) { if (is_complex) error.SetErrorString ("We don't support returning complex values at present"); @@ -764,20 +741,16 @@ ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb ValueObjectSP ABIMacOSX_i386::GetReturnValueObjectImpl (Thread &thread, - ClangASTType &ast_type) const + ClangASTType &clang_type) const { Value value; ValueObjectSP return_valobj_sp; - void *value_type = ast_type.GetOpaqueQualType(); - if (!value_type) + if (!clang_type) return return_valobj_sp; - clang::ASTContext *ast_context = ast_type.GetASTContext(); - if (!ast_context) - return return_valobj_sp; - - value.SetContext (Value::eContextTypeClangType, value_type); + //value.SetContext (Value::eContextTypeClangType, clang_type.GetOpaqueQualType()); + value.SetClangType (clang_type); RegisterContext *reg_ctx = thread.GetRegisterContext().get(); if (!reg_ctx) @@ -785,9 +758,9 @@ ABIMacOSX_i386::GetReturnValueObjectImpl (Thread &thread, bool is_signed; - if (ClangASTContext::IsIntegerType (value_type, is_signed)) + if (clang_type.IsIntegerType (is_signed)) { - size_t bit_width = ClangASTType::GetClangTypeBitWidth(ast_context, value_type); + size_t bit_width = clang_type.GetBitSize(); unsigned eax_id = reg_ctx->GetRegisterInfoByName("eax", 0)->kinds[eRegisterKindLLDB]; unsigned edx_id = reg_ctx->GetRegisterInfoByName("edx", 0)->kinds[eRegisterKindLLDB]; @@ -827,7 +800,7 @@ ABIMacOSX_i386::GetReturnValueObjectImpl (Thread &thread, break; } } - else if (ClangASTContext::IsPointerType (value_type)) + else if (clang_type.IsPointerType ()) { unsigned eax_id = reg_ctx->GetRegisterInfoByName("eax", 0)->kinds[eRegisterKindLLDB]; uint32_t ptr = thread.GetRegisterContext()->ReadRegisterAsUnsigned(eax_id, 0) & 0xffffffff; @@ -841,11 +814,9 @@ ABIMacOSX_i386::GetReturnValueObjectImpl (Thread &thread, // If we get here, we have a valid Value, so make our ValueObject out of it: - return_valobj_sp = ValueObjectConstResult::Create( - thread.GetStackFrameAtIndex(0).get(), - ast_type.GetASTContext(), - value, - ConstString("")); + return_valobj_sp = ValueObjectConstResult::Create(thread.GetStackFrameAtIndex(0).get(), + value, + ConstString("")); return return_valobj_sp; } diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp index a9b002c03df..1ff9124316f 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -313,14 +313,39 @@ ABISysV_x86_64::PrepareTrivialCall (Thread &thread, Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); if (log) - log->Printf("ABISysV_x86_64::PrepareTrivialCall\n(\n thread = %p\n sp = 0x%" PRIx64 "\n func_addr = 0x%" PRIx64 "\n return_addr = 0x%" PRIx64 "\n arg1_ptr = %p (0x%" PRIx64 ")\n arg2_ptr = %p (0x%" PRIx64 ")\n arg3_ptr = %p (0x%" PRIx64 ")\n)", - (void*)&thread, + { + StreamString s; + s.Printf("ABISysV_x86_64::PrepareTrivialCall (tid = 0x%" PRIx64 ", sp = 0x%" PRIx64 ", func_addr = 0x%" PRIx64 ", return_addr = 0x%" PRIx64, + thread.GetID(), (uint64_t)sp, (uint64_t)func_addr, - (uint64_t)return_addr, - arg1_ptr, arg1_ptr ? (uint64_t)*arg1_ptr : (uint64_t) 0, - arg2_ptr, arg2_ptr ? (uint64_t)*arg2_ptr : (uint64_t) 0, - arg3_ptr, arg3_ptr ? (uint64_t)*arg3_ptr : (uint64_t) 0); + (uint64_t)return_addr); + + if (arg1_ptr) + { + s.Printf (", arg1 = 0x%" PRIx64, (uint64_t)*arg1_ptr); + if (arg2_ptr) + { + s.Printf (", arg2 = 0x%" PRIx64, (uint64_t)*arg2_ptr); + if (arg3_ptr) + { + s.Printf (", arg3 = 0x%" PRIx64, (uint64_t)*arg3_ptr); + if (arg4_ptr) + { + s.Printf (", arg4 = 0x%" PRIx64, (uint64_t)*arg4_ptr); + if (arg5_ptr) + { + s.Printf (", arg5 = 0x%" PRIx64, (uint64_t)*arg5_ptr); + if (arg6_ptr) + s.Printf (", arg6 = 0x%" PRIx64, (uint64_t)*arg6_ptr); + } + } + } + } + } + s.PutCString (")"); + log->PutCString(s.GetString().c_str()); + } RegisterContext *reg_ctx = thread.GetRegisterContext().get(); if (!reg_ctx) @@ -461,12 +486,7 @@ ABISysV_x86_64::GetArgumentValues (Thread &thread, { unsigned int num_values = values.GetSize(); unsigned int value_index; - - // For now, assume that the types in the AST values come from the Target's - // scratch AST. - - clang::ASTContext *ast = thread.CalculateTarget()->GetScratchClangASTContext()->getASTContext(); - + // Extract the register context so we can read arguments from registers RegisterContext *reg_ctx = thread.GetRegisterContext().get(); @@ -506,39 +526,30 @@ ABISysV_x86_64::GetArgumentValues (Thread &thread, // We currently only support extracting values with Clang QualTypes. // Do we care about others? - switch (value->GetContextType()) - { - default: + ClangASTType clang_type = value->GetClangType(); + if (!clang_type) return false; - case Value::eContextTypeClangType: - { - void *value_type = value->GetClangType(); - bool is_signed; - - if (ClangASTContext::IsIntegerType (value_type, is_signed)) - { - size_t bit_width = ClangASTType::GetClangTypeBitWidth(ast, value_type); - - ReadIntegerArgument(value->GetScalar(), - bit_width, - is_signed, - thread, - argument_register_ids, - current_argument_register, - current_stack_argument); - } - else if (ClangASTContext::IsPointerType (value_type)) - { - ReadIntegerArgument(value->GetScalar(), - 64, - false, - thread, - argument_register_ids, - current_argument_register, - current_stack_argument); - } - } - break; + bool is_signed; + + if (clang_type.IsIntegerType (is_signed)) + { + ReadIntegerArgument(value->GetScalar(), + clang_type.GetBitSize(), + is_signed, + thread, + argument_register_ids, + current_argument_register, + current_stack_argument); + } + else if (clang_type.IsPointerType ()) + { + ReadIntegerArgument(value->GetScalar(), + clang_type.GetBitSize(), + false, + thread, + argument_register_ids, + current_argument_register, + current_stack_argument); } } @@ -555,19 +566,13 @@ ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb return error; } - clang_type_t value_type = new_value_sp->GetClangType(); - if (!value_type) + ClangASTType clang_type = new_value_sp->GetClangType(); + if (!clang_type) { error.SetErrorString ("Null clang type for return value."); return error; } - clang::ASTContext *ast = new_value_sp->GetClangAST(); - if (!ast) - { - error.SetErrorString ("Null clang AST for return value."); - return error; - } Thread *thread = frame_sp->GetThread().get(); bool is_signed; @@ -577,7 +582,7 @@ ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb RegisterContext *reg_ctx = thread->GetRegisterContext().get(); bool set_it_simple = false; - if (ClangASTContext::IsIntegerType (value_type, is_signed) || ClangASTContext::IsPointerType(value_type)) + if (clang_type.IsIntegerType (is_signed) || clang_type.IsPointerType()) { const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName("rax", 0); @@ -597,13 +602,13 @@ ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb } } - else if (ClangASTContext::IsFloatingPointType (value_type, count, is_complex)) + else if (clang_type.IsFloatingPointType (count, is_complex)) { if (is_complex) error.SetErrorString ("We don't support returning complex values at present"); else { - size_t bit_width = ClangASTType::GetClangTypeBitWidth(ast, value_type); + size_t bit_width = clang_type.GetBitSize(); if (bit_width <= 64) { const RegisterInfo *xmm0_info = reg_ctx->GetRegisterInfoByName("xmm0", 0); @@ -640,38 +645,34 @@ ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb ValueObjectSP ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, - ClangASTType &ast_type) const + ClangASTType &return_clang_type) const { ValueObjectSP return_valobj_sp; Value value; - clang_type_t return_value_type = ast_type.GetOpaqueQualType(); - if (!return_value_type) - return return_valobj_sp; - - clang::ASTContext *ast = ast_type.GetASTContext(); - if (!ast) + if (!return_clang_type) return return_valobj_sp; - value.SetContext (Value::eContextTypeClangType, return_value_type); + //value.SetContext (Value::eContextTypeClangType, return_value_type); + value.SetClangType (return_clang_type); RegisterContext *reg_ctx = thread.GetRegisterContext().get(); if (!reg_ctx) return return_valobj_sp; - const uint32_t type_flags = ClangASTContext::GetTypeInfo (return_value_type, ast, NULL); - if (type_flags & ClangASTContext::eTypeIsScalar) + const uint32_t type_flags = return_clang_type.GetTypeInfo (); + if (type_flags & ClangASTType::eTypeIsScalar) { value.SetValueType(Value::eValueTypeScalar); bool success = false; - if (type_flags & ClangASTContext::eTypeIsInteger) + if (type_flags & ClangASTType::eTypeIsInteger) { // Extract the register context so we can read arguments from registers - const size_t byte_size = ClangASTType::GetClangTypeByteSize(ast, return_value_type); + const size_t byte_size = return_clang_type.GetByteSize(); uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(reg_ctx->GetRegisterInfoByName("rax", 0), 0); - const bool is_signed = (type_flags & ClangASTContext::eTypeIsSigned) != 0; + const bool is_signed = (type_flags & ClangASTType::eTypeIsSigned) != 0; switch (byte_size) { default: @@ -710,15 +711,15 @@ ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, break; } } - else if (type_flags & ClangASTContext::eTypeIsFloat) + else if (type_flags & ClangASTType::eTypeIsFloat) { - if (type_flags & ClangASTContext::eTypeIsComplex) + if (type_flags & ClangASTType::eTypeIsComplex) { // Don't handle complex yet. } else { - const size_t byte_size = ClangASTType::GetClangTypeByteSize(ast, return_value_type); + const size_t byte_size = return_clang_type.GetByteSize(); if (byte_size <= sizeof(long double)) { const RegisterInfo *xmm0_info = reg_ctx->GetRegisterInfoByName("xmm0", 0); @@ -751,24 +752,22 @@ ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, if (success) return_valobj_sp = ValueObjectConstResult::Create (thread.GetStackFrameAtIndex(0).get(), - ast_type.GetASTContext(), value, ConstString("")); } - else if (type_flags & ClangASTContext::eTypeIsPointer) + else if (type_flags & ClangASTType::eTypeIsPointer) { unsigned rax_id = reg_ctx->GetRegisterInfoByName("rax", 0)->kinds[eRegisterKindLLDB]; value.GetScalar() = (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(rax_id, 0); value.SetValueType(Value::eValueTypeScalar); return_valobj_sp = ValueObjectConstResult::Create (thread.GetStackFrameAtIndex(0).get(), - ast_type.GetASTContext(), value, ConstString("")); } - else if (type_flags & ClangASTContext::eTypeIsVector) + else if (type_flags & ClangASTType::eTypeIsVector) { - const size_t byte_size = ClangASTType::GetClangTypeByteSize(ast, return_value_type); + const size_t byte_size = return_clang_type.GetByteSize(); if (byte_size > 0) { @@ -803,8 +802,7 @@ ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, byte_order, process_sp->GetTarget().GetArchitecture().GetAddressByteSize()); return_valobj_sp = ValueObjectConstResult::Create (&thread, - ast, - return_value_type, + return_clang_type, ConstString(""), data); } @@ -819,29 +817,24 @@ ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread, } ValueObjectSP -ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type) const +ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &return_clang_type) const { ValueObjectSP return_valobj_sp; + + if (!return_clang_type) + return return_valobj_sp; ExecutionContext exe_ctx (thread.shared_from_this()); - return_valobj_sp = GetReturnValueObjectSimple(thread, ast_type); + return_valobj_sp = GetReturnValueObjectSimple(thread, return_clang_type); if (return_valobj_sp) return return_valobj_sp; - clang_type_t return_value_type = ast_type.GetOpaqueQualType(); - if (!return_value_type) - return return_valobj_sp; - - clang::ASTContext *ast = ast_type.GetASTContext(); - if (!ast) - return return_valobj_sp; - RegisterContextSP reg_ctx_sp = thread.GetRegisterContext(); if (!reg_ctx_sp) return return_valobj_sp; - size_t bit_width = ClangASTType::GetClangTypeBitWidth(ast, return_value_type); - if (ClangASTContext::IsAggregateType(return_value_type)) + const size_t bit_width = return_clang_type.GetBitSize(); + if (return_clang_type.IsAggregateType()) { Target *target = exe_ctx.GetTargetPtr(); bool is_memory = true; @@ -874,7 +867,7 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type uint32_t fp_bytes = 0; // Tracks how much of the xmm registers we've consumed so far uint32_t integer_bytes = 0; // Tracks how much of the rax/rds registers we've consumed so far - uint32_t num_children = ClangASTContext::GetNumFields (ast, return_value_type); + const uint32_t num_children = return_clang_type.GetNumFields (); // Since we are in the small struct regime, assume we are not in memory. is_memory = false; @@ -887,8 +880,8 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type bool is_complex; uint32_t count; - clang_type_t field_clang_type = ClangASTContext::GetFieldAtIndex (ast, return_value_type, idx, name, &field_bit_offset, NULL, NULL); - size_t field_bit_width = ClangASTType::GetClangTypeBitWidth(ast, field_clang_type); + ClangASTType field_clang_type = return_clang_type.GetFieldAtIndex (idx, name, &field_bit_offset, NULL, NULL); + const size_t field_bit_width = field_clang_type.GetBitSize(); // If there are any unaligned fields, this is stored in memory. if (field_bit_offset % field_bit_width != 0) @@ -904,7 +897,7 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type DataExtractor *copy_from_extractor = NULL; uint32_t copy_from_offset = 0; - if (ClangASTContext::IsIntegerType (field_clang_type, is_signed) || ClangASTContext::IsPointerType (field_clang_type)) + if (field_clang_type.IsIntegerType (is_signed) || field_clang_type.IsPointerType ()) { if (integer_bytes < 8) { @@ -937,7 +930,7 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type return return_valobj_sp; } } - else if (ClangASTContext::IsFloatingPointType (field_clang_type, count, is_complex)) + else if (field_clang_type.IsFloatingPointType (count, is_complex)) { // Structs with long doubles are always passed in memory. if (field_bit_width == 128) @@ -970,14 +963,12 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type else { uint64_t next_field_bit_offset = 0; - clang_type_t next_field_clang_type = ClangASTContext::GetFieldAtIndex (ast, - return_value_type, - idx + 1, - name, - &next_field_bit_offset, - NULL, - NULL); - if (ClangASTContext::IsIntegerType (next_field_clang_type, is_signed)) + ClangASTType next_field_clang_type = return_clang_type.GetFieldAtIndex (idx + 1, + name, + &next_field_bit_offset, + NULL, + NULL); + if (next_field_clang_type.IsIntegerType (is_signed)) in_gpr = true; else { @@ -996,14 +987,12 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type else { uint64_t prev_field_bit_offset = 0; - clang_type_t prev_field_clang_type = ClangASTContext::GetFieldAtIndex (ast, - return_value_type, - idx - 1, - name, - &prev_field_bit_offset, - NULL, - NULL); - if (ClangASTContext::IsIntegerType (prev_field_clang_type, is_signed)) + ClangASTType prev_field_clang_type = return_clang_type.GetFieldAtIndex (idx - 1, + name, + &prev_field_bit_offset, + NULL, + NULL); + if (prev_field_clang_type.IsIntegerType (is_signed)) in_gpr = true; else { @@ -1067,8 +1056,7 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type { // The result is in our data buffer. Let's make a variable object out of it: return_valobj_sp = ValueObjectConstResult::Create (&thread, - ast, - return_value_type, + return_clang_type, ConstString(""), return_ext); } @@ -1087,7 +1075,7 @@ ABISysV_x86_64::GetReturnValueObjectImpl (Thread &thread, ClangASTType &ast_type return_valobj_sp = ValueObjectMemory::Create (&thread, "", Address (storage_addr, NULL), - ast_type); + return_clang_type); } } diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index b7375d88035..df83b4df50b 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -625,13 +625,15 @@ DynamicLoaderMacOSXDYLD::NotifyBreakpointHit (void *baton, ValueList argument_values; Value input_value; - void *clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); - void *clang_uint32_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingUint, 32); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + ClangASTType clang_uint32_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingUint, 32); input_value.SetValueType (Value::eValueTypeScalar); - input_value.SetContext (Value::eContextTypeClangType, clang_uint32_type); - argument_values.PushValue(input_value); - argument_values.PushValue(input_value); - input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + input_value.SetClangType (clang_uint32_type); +// input_value.SetContext (Value::eContextTypeClangType, clang_uint32_type); + argument_values.PushValue (input_value); + argument_values.PushValue (input_value); + input_value.SetClangType (clang_void_ptr_type); + // input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); argument_values.PushValue (input_value); if (abi->GetArgumentValues (exe_ctx.GetThreadRef(), argument_values)) diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp index 8a0d218ab34..247d7b0e7fe 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -37,9 +37,9 @@ static const char *vtable_demangled_prefix = "vtable for "; bool ItaniumABILanguageRuntime::CouldHaveDynamicValue (ValueObject &in_value) { - return ClangASTContext::IsPossibleDynamicType(in_value.GetClangAST(), in_value.GetClangType(), NULL, - true, // check for C++ - false); // do not check for ObjC + const bool check_cxx = true; + const bool check_objc = false; + return in_value.GetClangType().IsPossibleDynamicType (NULL, check_cxx, check_objc); } bool @@ -188,7 +188,7 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value, type_sp = class_types.GetTypeAtIndex(i); if (type_sp) { - if (ClangASTContext::IsCXXClassType(type_sp->GetClangFullType())) + if (type_sp->GetClangFullType().IsCXXClassType()) { if (log) log->Printf ("0x%16.16" PRIx64 ": static-type = '%s' has multiple matching dynamic types, picking this one: uid={0x%" PRIx64 "}, type-name='%s'\n", @@ -220,18 +220,12 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value, // the value we were handed. if (type_sp) { - clang::ASTContext *in_ast_ctx = in_value.GetClangAST (); - clang::ASTContext *this_ast_ctx = type_sp->GetClangAST (); - if (in_ast_ctx == this_ast_ctx) + if (ClangASTContext::AreTypesSame (in_value.GetClangType(), + type_sp->GetClangFullType())) { - if (ClangASTContext::AreTypesSame (in_ast_ctx, - in_value.GetClangType(), - type_sp->GetClangFullType())) - { - // The dynamic type we found was the same type, - // so we don't have a dynamic type here... - return false; - } + // The dynamic type we found was the same type, + // so we don't have a dynamic type here... + return false; } // The offset_to_top is two pointers above the address. diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 1f3f4e0ca3f..b21d76ca660 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -81,10 +81,10 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon return false; Target *target = exe_ctx.GetTargetPtr(); - if (value.GetClangType()) + ClangASTType clang_type = value.GetClangType(); + if (clang_type) { - clang::QualType value_type = clang::QualType::getFromOpaquePtr (value.GetClangType()); - if (!value_type->isObjCObjectPointerType()) + if (!clang_type.IsObjCObjectPointerType()) { strm.Printf ("Value doesn't point to an ObjC object.\n"); return false; @@ -94,10 +94,11 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon { // If it is not a pointer, see if we can make it into a pointer. ClangASTContext *ast_context = target->GetScratchClangASTContext(); - void *opaque_type_ptr = ast_context->GetBuiltInType_objc_id(); - if (opaque_type_ptr == NULL) - opaque_type_ptr = ast_context->GetVoidPtrType(false); - value.SetContext(Value::eContextTypeClangType, opaque_type_ptr); + ClangASTType opaque_type = ast_context->GetBasicType(eBasicTypeObjCID); + if (!opaque_type) + opaque_type = ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + //value.SetContext(Value::eContextTypeClangType, opaque_type_ptr); + value.SetClangType (opaque_type); } ValueList arg_value_list; @@ -106,9 +107,10 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon // This is the return value: ClangASTContext *ast_context = target->GetScratchClangASTContext(); - void *return_qualtype = ast_context->GetCStringType(true); + ClangASTType return_clang_type = ast_context->GetCStringType(true); Value ret; - ret.SetContext(Value::eContextTypeClangType, return_qualtype); +// ret.SetContext(Value::eContextTypeClangType, return_clang_type); + ret.SetClangType (return_clang_type); if (exe_ctx.GetFramePtr() == NULL) { @@ -126,8 +128,7 @@ AppleObjCRuntime::GetObjectDescription (Stream &strm, Value &value, ExecutionCon // Now we're ready to call the function: ClangFunction func (*exe_ctx.GetBestExecutionContextScope(), - ast_context, - return_qualtype, + return_clang_type, *function_address, arg_value_list); @@ -221,10 +222,9 @@ AppleObjCRuntime::GetPrintForDebuggerAddr() bool AppleObjCRuntime::CouldHaveDynamicValue (ValueObject &in_value) { - return ClangASTContext::IsPossibleDynamicType(in_value.GetClangAST(), in_value.GetClangType(), - NULL, - false, // do not check C++ - true); // check ObjC + return in_value.GetClangType().IsPossibleDynamicType (NULL, + false, // do not check C++ + true); // check ObjC } bool diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp index 6d3d4fd5f8d..16ffe0b042a 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -178,13 +178,14 @@ AppleObjCRuntimeV1::CreateObjectChecker(const char *name) //ObjCLanguageRuntime::ObjCISA //AppleObjCRuntimeV1::GetISA(ValueObject& valobj) //{ -//// if (ClangASTType::GetMinimumLanguage(valobj.GetClangAST(),valobj.GetClangType()) != eLanguageTypeObjC) +// ClangASTType valobj_clang_type = valobj.GetClangType(); +//// if (valobj_clang_type.GetMinimumLanguage() != eLanguageTypeObjC) //// return 0; // // // if we get an invalid VO (which might still happen when playing around // // with pointers returned by the expression parser, don't consider this // // a valid ObjC object) -// if (valobj.GetValue().GetContextType() == Value::eContextTypeInvalid) +// if (!valobj.GetClangType().IsValid()) // return 0; // // addr_t isa_pointer = valobj.GetPointerValue(); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 683645a47af..23a0e23e7c5 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -1613,7 +1613,7 @@ AppleObjCRuntimeV2::GetClassDescriptor (ValueObject& valobj) // if we get an invalid VO (which might still happen when playing around // with pointers returned by the expression parser, don't consider this // a valid ObjC object) - if (valobj.GetValue().GetContextType() != Value::eContextTypeInvalid) + if (valobj.GetClangType().IsValid()) { addr_t isa_pointer = valobj.GetPointerValue(); @@ -1719,8 +1719,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table } // Make some types for our arguments - clang_type_t clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); - clang_type_t clang_void_pointer_type = ast->CreatePointerType(ast->GetBuiltInType_void()); + ClangASTType clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); + ClangASTType clang_void_pointer_type = ast->GetBasicType(eBasicTypeVoid).GetPointerType(); if (!m_get_class_info_code.get()) { @@ -1749,19 +1749,17 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table { Value value; value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); +// value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); + value.SetClangType (clang_void_pointer_type); arguments.PushValue (value); - - value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); arguments.PushValue (value); value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); +// value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + value.SetClangType (clang_uint32_t_type); arguments.PushValue (value); m_get_class_info_function.reset(new ClangFunction (*m_process, - ast, clang_uint32_t_type, function_address, arguments)); @@ -1827,7 +1825,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(RemoteNXMapTable &hash_table Value return_value; return_value.SetValueType (Value::eValueTypeScalar); - return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + //return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + return_value.SetClangType (clang_uint32_t_type); return_value.GetScalar() = 0; errors.Clear(); @@ -1971,8 +1970,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() } // Make some types for our arguments - clang_type_t clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); - clang_type_t clang_void_pointer_type = ast->CreatePointerType(ast->GetBuiltInType_void()); + ClangASTType clang_uint32_t_type = ast->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, 32); + ClangASTType clang_void_pointer_type = ast->GetBasicType(eBasicTypeVoid).GetPointerType(); if (!m_get_shared_cache_class_info_code.get()) { @@ -2001,19 +2000,17 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() { Value value; value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); + //value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); + value.SetClangType (clang_void_pointer_type); arguments.PushValue (value); - - value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_void_pointer_type); arguments.PushValue (value); value.SetValueType (Value::eValueTypeScalar); - value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + //value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + value.SetClangType (clang_uint32_t_type); arguments.PushValue (value); m_get_shared_cache_class_info_function.reset(new ClangFunction (*m_process, - ast, clang_uint32_t_type, function_address, arguments)); @@ -2079,7 +2076,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() Value return_value; return_value.SetValueType (Value::eValueTypeScalar); - return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + //return_value.SetContext (Value::eContextTypeClangType, clang_uint32_t_type); + return_value.SetClangType (clang_uint32_t_type); return_value.GetScalar() = 0; errors.Clear(); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index a76326eba19..b7c5df200c0 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -512,9 +512,11 @@ AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines (void *baton, ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); ValueList argument_values; Value input_value; - void *clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + input_value.SetValueType (Value::eValueTypeScalar); - input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + //input_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + input_value.SetClangType (clang_void_ptr_type); argument_values.PushValue(input_value); bool success = abi->GetArgumentValues (exe_ctx.GetThreadRef(), argument_values); @@ -525,7 +527,6 @@ AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines (void *baton, Error error; DataExtractor data; error = argument_values.GetValueAtIndex(0)->GetValueAsData (&exe_ctx, - clang_ast_context->getASTContext(), data, 0, NULL); @@ -783,13 +784,12 @@ AppleObjCTrampolineHandler::SetupDispatchFunction (Thread &thread, ValueList &di // Next make the runner function for our implementation utility function. if (!m_impl_function.get()) { - ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); - lldb::clang_type_t clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); - m_impl_function.reset(new ClangFunction (thread, - clang_ast_context, - clang_void_ptr_type, - impl_code_address, - dispatch_values)); + ClangASTContext *clang_ast_context = thread.GetProcess()->GetTarget().GetScratchClangASTContext(); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); + m_impl_function.reset(new ClangFunction (thread, + clang_void_ptr_type, + impl_code_address, + dispatch_values)); errors.Clear(); unsigned num_errors = m_impl_function->CompileFunction(errors); @@ -887,9 +887,10 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto ClangASTContext *clang_ast_context = target_sp->GetScratchClangASTContext(); ValueList argument_values; Value void_ptr_value; - lldb::clang_type_t clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); void_ptr_value.SetValueType (Value::eValueTypeScalar); - void_ptr_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + //void_ptr_value.SetContext (Value::eContextTypeClangType, clang_void_ptr_type); + void_ptr_value.SetClangType (clang_void_ptr_type); int obj_index; int sel_index; @@ -949,14 +950,14 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto Value super_value(*(argument_values.GetValueAtIndex(obj_index))); super_value.GetScalar() += process->GetAddressByteSize(); - super_value.ResolveValue (&exe_ctx, clang_ast_context->getASTContext()); + super_value.ResolveValue (&exe_ctx); if (super_value.GetScalar().IsValid()) { // isa_value now holds the class pointer. The second word of the class pointer is the super-class pointer: super_value.GetScalar() += process->GetAddressByteSize(); - super_value.ResolveValue (&exe_ctx, clang_ast_context->getASTContext()); + super_value.ResolveValue (&exe_ctx); if (super_value.GetScalar().IsValid()) isa_addr = super_value.GetScalar().ULongLong(); else @@ -979,7 +980,7 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto Value super_value(*(argument_values.GetValueAtIndex(obj_index))); super_value.GetScalar() += process->GetAddressByteSize(); - super_value.ResolveValue (&exe_ctx, clang_ast_context->getASTContext()); + super_value.ResolveValue (&exe_ctx); if (super_value.GetScalar().IsValid()) { @@ -1006,7 +1007,7 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto Value isa_value(*(argument_values.GetValueAtIndex(obj_index))); isa_value.SetValueType(Value::eValueTypeLoadAddress); - isa_value.ResolveValue(&exe_ctx, clang_ast_context->getASTContext()); + isa_value.ResolveValue(&exe_ctx); if (isa_value.GetScalar().IsValid()) { isa_addr = isa_value.GetScalar().ULongLong(); @@ -1068,10 +1069,10 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan (Thread &thread, bool sto dispatch_values.PushValue (*(argument_values.GetValueAtIndex(sel_index))); Value flag_value; - lldb::clang_type_t clang_int_type - = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingSint, 32); + ClangASTType clang_int_type = clang_ast_context->GetBuiltinTypeForEncodingAndBitSize(lldb::eEncodingSint, 32); flag_value.SetValueType (Value::eValueTypeScalar); - flag_value.SetContext (Value::eContextTypeClangType, clang_int_type); + //flag_value.SetContext (Value::eContextTypeClangType, clang_int_type); + flag_value.SetClangType (clang_int_type); if (this_dispatch.stret_return) flag_value.GetScalar() = 1; diff --git a/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp b/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp index ba1d3b6eb95..499d6d76615 100644 --- a/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp +++ b/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp @@ -76,11 +76,11 @@ bool lldb_private::InferiorCallMmap(Process *process, addr_t &allocated_addr, if (sc.GetAddressRange(range_scope, 0, use_inline_block_range, mmap_range)) { ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); - lldb::clang_type_t clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); ThreadPlanCallFunction *call_function_thread_plan = new ThreadPlanCallFunction (*thread, mmap_range.GetBaseAddress(), - ClangASTType (clang_ast_context->getASTContext(), clang_void_ptr_type), + clang_void_ptr_type, stop_other_threads, unwind_on_error, ignore_breakpoints, @@ -222,11 +222,11 @@ bool lldb_private::InferiorCall(Process *process, const Address *address, addr_t const uint32_t timeout_usec = 500000; ClangASTContext *clang_ast_context = process->GetTarget().GetScratchClangASTContext(); - lldb::clang_type_t clang_void_ptr_type = clang_ast_context->GetVoidPtrType(false); + ClangASTType clang_void_ptr_type = clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); ThreadPlanCallFunction *call_function_thread_plan = new ThreadPlanCallFunction (*thread, *address, - ClangASTType (clang_ast_context->getASTContext(), clang_void_ptr_type), + clang_void_ptr_type, stop_other_threads, unwind_on_error, ignore_breakpoints); diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp index 84343b92425..4d60cf0708b 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp @@ -1179,7 +1179,7 @@ RegisterContextLLDB::SavedLocationForRegister (uint32_t lldb_regnum, lldb_privat dwarfexpr.SetRegisterKind (unwindplan_registerkind); Value result; Error error; - if (dwarfexpr.Evaluate (&exe_ctx, NULL, NULL, NULL, this, 0, NULL, result, &error)) + if (dwarfexpr.Evaluate (&exe_ctx, NULL, NULL, this, 0, NULL, result, &error)) { addr_t val; val = result.GetScalar().ULongLong(); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index fa2d05819c4..b8d73d4bf2f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -407,11 +407,11 @@ SymbolFileDWARF::GetTypes (SymbolContextScope *sc_scope, // }); // } - std::set<clang_type_t> clang_type_set; + std::set<ClangASTType> clang_type_set; size_t num_types_added = 0; for (Type *type : type_set) { - clang_type_t clang_type = type->GetClangForwardType(); + ClangASTType clang_type = type->GetClangForwardType(); if (clang_type_set.find(clang_type) == clang_type_set.end()) { clang_type_set.insert(clang_type); @@ -1424,7 +1424,7 @@ SymbolFileDWARF::ParseTemplateDIE (DWARFCompileUnit* dwarf_cu, attributes); const char *name = NULL; Type *lldb_type = NULL; - clang_type_t clang_type = NULL; + ClangASTType clang_type; uint64_t uval64 = 0; bool uval64_valid = false; if (num_attributes > 0) @@ -1465,7 +1465,7 @@ SymbolFileDWARF::ParseTemplateDIE (DWARFCompileUnit* dwarf_cu, clang::ASTContext *ast = GetClangASTContext().getASTContext(); if (!clang_type) - clang_type = ast->VoidTy.getAsOpaquePtr(); + clang_type = GetClangASTContext().GetBasicType(eBasicTypeVoid); if (clang_type) { @@ -1475,20 +1475,19 @@ SymbolFileDWARF::ParseTemplateDIE (DWARFCompileUnit* dwarf_cu, else template_param_infos.names.push_back(NULL); - clang::QualType clang_qual_type (clang::QualType::getFromOpaquePtr (clang_type)); if (tag == DW_TAG_template_value_parameter && lldb_type != NULL && - ClangASTContext::IsIntegerType (clang_type, is_signed) && + clang_type.IsIntegerType (is_signed) && uval64_valid) { llvm::APInt apint (lldb_type->GetByteSize() * 8, uval64, is_signed); template_param_infos.args.push_back (clang::TemplateArgument (*ast, llvm::APSInt(apint), - clang_qual_type)); + clang_type.GetQualType())); } else { - template_param_infos.args.push_back (clang::TemplateArgument (clang_qual_type)); + template_param_infos.args.push_back (clang::TemplateArgument (clang_type.GetQualType())); } } else @@ -1565,17 +1564,15 @@ class SymbolFileDWARF::DelayedAddObjCClassProperty public: DelayedAddObjCClassProperty ( - clang::ASTContext *ast, - lldb::clang_type_t class_opaque_type, + const ClangASTType &class_opaque_type, const char *property_name, - lldb::clang_type_t property_opaque_type, // The property type is only required if you don't have an ivar decl + const ClangASTType &property_opaque_type, // The property type is only required if you don't have an ivar decl clang::ObjCIvarDecl *ivar_decl, const char *property_setter_name, const char *property_getter_name, uint32_t property_attributes, const ClangASTMetadata *metadata ) : - m_ast (ast), m_class_opaque_type (class_opaque_type), m_property_name (property_name), m_property_opaque_type (property_opaque_type), @@ -1593,12 +1590,11 @@ public: DelayedAddObjCClassProperty (const DelayedAddObjCClassProperty &rhs) { - *this = rhs; + *this = rhs; } DelayedAddObjCClassProperty& operator= (const DelayedAddObjCClassProperty &rhs) { - m_ast = rhs.m_ast; m_class_opaque_type = rhs.m_class_opaque_type; m_property_name = rhs.m_property_name; m_property_opaque_type = rhs.m_property_opaque_type; @@ -1615,23 +1611,21 @@ public: return *this; } - bool Finalize() const - { - return ClangASTContext::AddObjCClassProperty (m_ast, - m_class_opaque_type, - m_property_name, - m_property_opaque_type, - m_ivar_decl, - m_property_setter_name, - m_property_getter_name, - m_property_attributes, - m_metadata_ap.get()); + bool + Finalize() + { + return m_class_opaque_type.AddObjCClassProperty (m_property_name, + m_property_opaque_type, + m_ivar_decl, + m_property_setter_name, + m_property_getter_name, + m_property_attributes, + m_metadata_ap.get()); } private: - clang::ASTContext *m_ast; - lldb::clang_type_t m_class_opaque_type; + ClangASTType m_class_opaque_type; const char *m_property_name; - lldb::clang_type_t m_property_opaque_type; + ClangASTType m_property_opaque_type; clang::ObjCIvarDecl *m_ivar_decl; const char *m_property_setter_name; const char *m_property_getter_name; @@ -1693,7 +1687,7 @@ SymbolFileDWARF::ParseChildMembers const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *parent_die, - clang_type_t class_clang_type, + ClangASTType &class_clang_type, const LanguageType class_language, std::vector<clang::CXXBaseSpecifier *>& base_classes, std::vector<int>& member_accessibilities, @@ -1772,7 +1766,6 @@ SymbolFileDWARF::ParseChildMembers uint32_t block_length = form_value.Unsigned(); uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart(); if (DWARFExpression::Evaluate(NULL, // ExecutionContext * - NULL, // clang::ASTContext * NULL, // ClangExpressionVariableList * NULL, // ClangExpressionDeclMap * NULL, // RegisterContext * @@ -1784,7 +1777,7 @@ SymbolFileDWARF::ParseChildMembers memberOffset, NULL)) { - member_byte_offset = memberOffset.ResolveValue(NULL, NULL).UInt(); + member_byte_offset = memberOffset.ResolveValue(NULL).UInt(); } } break; @@ -1891,10 +1884,9 @@ SymbolFileDWARF::ParseChildMembers if (var_type) { - GetClangASTContext().AddVariableToRecordType (class_clang_type, - name, - var_type->GetClangLayoutType(), - accessibility); + class_clang_type.AddVariableToRecordType (name, + var_type->GetClangLayoutType(), + accessibility); } break; } @@ -2008,32 +2000,30 @@ SymbolFileDWARF::ParseChildMembers if (anon_field_info.IsValid()) { - clang::FieldDecl *unnamed_bitfield_decl = GetClangASTContext().AddFieldToRecordType (class_clang_type, - NULL, - GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, word_width), - accessibility, - anon_field_info.bit_size); + clang::FieldDecl *unnamed_bitfield_decl = class_clang_type.AddFieldToRecordType (NULL, + GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, word_width), + accessibility, + anon_field_info.bit_size); layout_info.field_offsets.insert(std::make_pair(unnamed_bitfield_decl, anon_field_info.bit_offset)); } } } - clang_type_t member_clang_type = member_type->GetClangLayoutType(); + ClangASTType member_clang_type = member_type->GetClangLayoutType(); { // Older versions of clang emit array[0] and array[1] in the same way (<rdar://problem/12566646>). // If the current field is at the end of the structure, then there is definitely no room for extra // elements and we override the type to array[0]. - clang_type_t member_array_element_type; + ClangASTType member_array_element_type; uint64_t member_array_size; bool member_array_is_incomplete; - if (GetClangASTContext().IsArrayType(member_clang_type, - &member_array_element_type, - &member_array_size, - &member_array_is_incomplete) && + if (member_clang_type.IsArrayType(&member_array_element_type, + &member_array_size, + &member_array_is_incomplete) && !member_array_is_incomplete) { uint64_t parent_byte_size = parent_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_byte_size, UINT64_MAX); @@ -2054,11 +2044,10 @@ SymbolFileDWARF::ParseChildMembers } } - field_decl = GetClangASTContext().AddFieldToRecordType (class_clang_type, - name, - member_clang_type, - accessibility, - bit_size); + field_decl = class_clang_type.AddFieldToRecordType (name, + member_clang_type, + accessibility, + bit_size); GetClangASTContext().SetMetadataAsUserID (field_decl, MakeUserID(die->GetOffset())); @@ -2094,8 +2083,7 @@ SymbolFileDWARF::ParseChildMembers ClangASTMetadata metadata; metadata.SetUserID (MakeUserID(die->GetOffset())); - delayed_properties.push_back(DelayedAddObjCClassProperty(GetClangASTContext().getASTContext(), - class_clang_type, + delayed_properties.push_back(DelayedAddObjCClassProperty(class_clang_type, prop_name, member_type->GetClangLayoutType(), ivar_decl, @@ -2162,7 +2150,6 @@ SymbolFileDWARF::ParseChildMembers if (DWARFExpression::Evaluate (NULL, NULL, NULL, - NULL, NULL, debug_info_data, block_offset, @@ -2172,7 +2159,7 @@ SymbolFileDWARF::ParseChildMembers memberOffset, NULL)) { - member_byte_offset = memberOffset.ResolveValue(NULL, NULL).UInt(); + member_byte_offset = memberOffset.ResolveValue(NULL).UInt(); } } break; @@ -2192,27 +2179,26 @@ SymbolFileDWARF::ParseChildMembers Type *base_class_type = ResolveTypeUID(encoding_uid); assert(base_class_type); - clang_type_t base_class_clang_type = base_class_type->GetClangFullType(); + ClangASTType base_class_clang_type = base_class_type->GetClangFullType(); assert (base_class_clang_type); if (class_language == eLanguageTypeObjC) { - GetClangASTContext().SetObjCSuperClass(class_clang_type, base_class_clang_type); + class_clang_type.SetObjCSuperClass(base_class_clang_type); } else { - base_classes.push_back (GetClangASTContext().CreateBaseClassSpecifier (base_class_clang_type, - accessibility, + base_classes.push_back (base_class_clang_type.CreateBaseClassSpecifier (accessibility, is_virtual, is_base_of_class)); if (is_virtual) { - layout_info.vbase_offsets.insert(std::make_pair(ClangASTType::GetAsCXXRecordDecl(class_clang_type), + layout_info.vbase_offsets.insert(std::make_pair(class_clang_type.GetAsCXXRecordDecl(), clang::CharUnits::fromQuantity(member_byte_offset))); } else { - layout_info.base_offsets.insert(std::make_pair(ClangASTType::GetAsCXXRecordDecl(class_clang_type), + layout_info.base_offsets.insert(std::make_pair(class_clang_type.GetAsCXXRecordDecl(), clang::CharUnits::fromQuantity(member_byte_offset))); } } @@ -2331,35 +2317,35 @@ SymbolFileDWARF::ResolveTypeUID (DWARFCompileUnit* cu, const DWARFDebugInfoEntry // SymbolFileDWARF objects to detect if this DWARF file is the one that // can resolve a clang_type. bool -SymbolFileDWARF::HasForwardDeclForClangType (lldb::clang_type_t clang_type) +SymbolFileDWARF::HasForwardDeclForClangType (const ClangASTType &clang_type) { - clang_type_t clang_type_no_qualifiers = ClangASTType::RemoveFastQualifiers(clang_type); - const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type_no_qualifiers); + ClangASTType clang_type_no_qualifiers = clang_type.RemoveFastQualifiers(); + const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type_no_qualifiers.GetOpaqueQualType()); return die != NULL; } -lldb::clang_type_t -SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type) +bool +SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (ClangASTType &clang_type) { // We have a struct/union/class/enum that needs to be fully resolved. - clang_type_t clang_type_no_qualifiers = ClangASTType::RemoveFastQualifiers(clang_type); - const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type_no_qualifiers); + ClangASTType clang_type_no_qualifiers = clang_type.RemoveFastQualifiers(); + const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (clang_type_no_qualifiers.GetOpaqueQualType()); if (die == NULL) { // We have already resolved this type... - return clang_type; + return true; } // Once we start resolving this type, remove it from the forward declaration // map in case anyone child members or other types require this type to get resolved. // The type will get resolved when all of the calls to SymbolFileDWARF::ResolveClangOpaqueTypeDefinition // are done. - m_forward_decl_clang_type_to_die.erase (clang_type_no_qualifiers); + m_forward_decl_clang_type_to_die.erase (clang_type_no_qualifiers.GetOpaqueQualType()); // Disable external storage for this type so we don't get anymore // clang::ExternalASTSource queries for this type. - ClangASTContext::SetHasExternalStorage (clang_type, false); + clang_type.SetHasExternalStorage (false); DWARFDebugInfo* debug_info = DebugInfo(); @@ -2381,8 +2367,6 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type assert (clang_type); DWARFDebugInfoEntry::Attributes attributes; - ClangASTContext &ast = GetClangASTContext(); - switch (tag) { case DW_TAG_structure_type: @@ -2396,13 +2380,12 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type { LanguageType class_language = eLanguageTypeUnknown; - bool is_objc_class = ClangASTContext::IsObjCClassType (clang_type); - if (is_objc_class) + if (clang_type.IsObjCObjectOrInterfaceType()) { class_language = eLanguageTypeObjC; // For objective C we don't start the definition when // the class is created. - ast.StartTagDeclarationDefinition (clang_type); + clang_type.StartTagDeclarationDefinition (); } int tag_decl_kind = -1; @@ -2456,7 +2439,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type if (class_language == eLanguageTypeObjC) { - std::string class_str (ClangASTType::GetTypeNameForOpaqueQualType(ast.getASTContext(), clang_type)); + std::string class_str (clang_type.GetTypeName()); if (!class_str.empty()) { @@ -2499,7 +2482,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type } } - for (DelayedPropertyList::const_iterator pi = delayed_properties.begin(), pe = delayed_properties.end(); + for (DelayedPropertyList::iterator pi = delayed_properties.begin(), pe = delayed_properties.end(); pi != pe; ++pi) pi->Finalize(); @@ -2511,7 +2494,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type if (class_language != eLanguageTypeObjC) { if (is_a_class && tag_decl_kind != clang::TTK_Class) - ast.SetTagTypeKind (clang_type, clang::TTK_Class); + clang_type.SetTagTypeKind (clang::TTK_Class); } // Since DW_TAG_structure_type gets used for both classes @@ -2528,29 +2511,26 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type { // This is a class and all members that didn't have // their access specified are private. - ast.SetDefaultAccessForRecordFields (clang_type, - eAccessPrivate, - &member_accessibilities.front(), - member_accessibilities.size()); + clang_type.SetDefaultAccessForRecordFields (eAccessPrivate, + &member_accessibilities.front(), + member_accessibilities.size()); } if (!base_classes.empty()) { - ast.SetBaseClassesForClassType (clang_type, - &base_classes.front(), - base_classes.size()); + clang_type.SetBaseClassesForClassType (&base_classes.front(), + base_classes.size()); // Clang will copy each CXXBaseSpecifier in "base_classes" // so we have to free them all. - ClangASTContext::DeleteBaseClassSpecifiers (&base_classes.front(), - base_classes.size()); + ClangASTType::DeleteBaseClassSpecifiers (&base_classes.front(), + base_classes.size()); } } } - ast.BuildIndirectFields (clang_type); - - ast.CompleteTagDeclarationDefinition (clang_type); + clang_type.BuildIndirectFields (); + clang_type.CompleteTagDeclarationDefinition (); if (!layout_info.field_offsets.empty() || !layout_info.base_offsets.empty() || @@ -2561,14 +2541,14 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type if (layout_info.bit_size == 0) layout_info.bit_size = die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_byte_size, 0) * 8; - clang::CXXRecordDecl *record_decl = ClangASTType::GetAsCXXRecordDecl(clang_type); + clang::CXXRecordDecl *record_decl = clang_type.GetAsCXXRecordDecl(); if (record_decl) { if (log) { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) caching layout info for record_decl = %p, bit_size = %" PRIu64 ", alignment = %" PRIu64 ", field_offsets[%u], base_offsets[%u], vbase_offsets[%u])", - clang_type, + clang_type.GetOpaqueQualType(), record_decl, layout_info.bit_size, layout_info.alignment, @@ -2583,7 +2563,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) field[%u] = { bit_offset=%u, name='%s' }", - clang_type, + clang_type.GetOpaqueQualType(), idx, (uint32_t)pos->second, pos->first->getNameAsString().c_str()); @@ -2596,7 +2576,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) base[%u] = { byte_offset=%u, name='%s' }", - clang_type, + clang_type.GetOpaqueQualType(), idx, (uint32_t)base_pos->second.getQuantity(), base_pos->first->getNameAsString().c_str()); @@ -2608,7 +2588,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type { GetObjectFile()->GetModule()->LogMessage (log, "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) vbase[%u] = { byte_offset=%u, name='%s' }", - clang_type, + clang_type.GetOpaqueQualType(), idx, (uint32_t)vbase_pos->second.getQuantity(), vbase_pos->first->getNameAsString().c_str()); @@ -2623,15 +2603,15 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type return clang_type; case DW_TAG_enumeration_type: - ast.StartTagDeclarationDefinition (clang_type); + clang_type.StartTagDeclarationDefinition (); if (die->HasChildren()) { SymbolContext sc(GetCompUnitForDWARFCompUnit(dwarf_cu)); bool is_signed = false; - ast.IsIntegerType(clang_type, is_signed); + clang_type.IsIntegerType(is_signed); ParseChildEnumerators(sc, clang_type, is_signed, type->GetByteSize(), dwarf_cu, die); } - ast.CompleteTagDeclarationDefinition (clang_type); + clang_type.CompleteTagDeclarationDefinition (); return clang_type; default: @@ -4142,7 +4122,7 @@ SymbolFileDWARF::ParseChildParameters (const SymbolContext& sc, bool skip_artificial, bool &is_static, TypeList* type_list, - std::vector<clang_type_t>& function_param_types, + std::vector<ClangASTType>& function_param_types, std::vector<clang::ParmVarDecl*>& function_param_decls, unsigned &type_quals, ClangASTContext::TemplateParameterInfos &template_param_infos) @@ -4308,7 +4288,7 @@ size_t SymbolFileDWARF::ParseChildEnumerators ( const SymbolContext& sc, - clang_type_t enumerator_clang_type, + lldb_private::ClangASTType &clang_type, bool is_signed, uint32_t enumerator_byte_size, DWARFCompileUnit* dwarf_cu, @@ -4370,12 +4350,11 @@ SymbolFileDWARF::ParseChildEnumerators if (name && name[0] && got_value) { - GetClangASTContext().AddEnumerationValueToEnumerationType (enumerator_clang_type, - enumerator_clang_type, - decl, - name, - enum_value, - enumerator_byte_size * 8); + clang_type.AddEnumerationValueToEnumerationType (clang_type.GetEnumerationIntegerType(), + decl, + name, + enum_value, + enumerator_byte_size * 8); ++enumerators_added; } } @@ -4643,7 +4622,7 @@ SymbolFileDWARF::GetClangDeclContextContainingDIE (DWARFCompileUnit *cu, const D Type* type = ResolveType (cu, decl_ctx_die); if (type) { - clang::DeclContext *decl_ctx = ClangASTContext::GetDeclContextForType (type->GetClangForwardType ()); + clang::DeclContext *decl_ctx = type->GetClangForwardType().GetDeclContextForType (); if (decl_ctx) { LinkDeclContextToDIE (decl_ctx, decl_ctx_die); @@ -5671,7 +5650,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, Declaration decl; Type::EncodingDataType encoding_data_type = Type::eEncodingIsUID; - clang_type_t clang_type = NULL; + ClangASTType clang_type; dw_attr_t attr; @@ -5744,7 +5723,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, strcmp(type_name_cstr, "decltype(nullptr)") == 0 ) { resolve_state = Type::eResolveStateFull; - clang_type = ast.getASTContext()->NullPtrTy.getAsOpaquePtr(); + clang_type = ast.GetBasicType(eBasicTypeNullPtr); break; } // Fall through to base type below in case we can handle the type there... @@ -5765,7 +5744,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, case DW_TAG_volatile_type: encoding_data_type = Type::eEncodingIsVolatileUID; break; } - if (clang_type == NULL && (encoding_data_type == Type::eEncodingIsPointerUID || encoding_data_type == Type::eEncodingIsTypedefUID) && sc.comp_unit != NULL) + if (!clang_type && (encoding_data_type == Type::eEncodingIsPointerUID || encoding_data_type == Type::eEncodingIsTypedefUID) && sc.comp_unit != NULL) { bool translation_unit_is_objc = (sc.comp_unit->GetLanguage() == eLanguageTypeObjC || sc.comp_unit->GetLanguage() == eLanguageTypeObjC_plus_plus); @@ -5784,7 +5763,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, die->GetOffset(), DW_TAG_value_to_name(die->Tag()), die->GetName(this, dwarf_cu)); - clang_type = ast.GetBuiltInType_objc_id(); + clang_type = ast.GetBasicType(eBasicTypeObjCID); encoding_data_type = Type::eEncodingIsUID; encoding_uid = LLDB_INVALID_UID; resolve_state = Type::eResolveStateFull; @@ -5797,7 +5776,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, die->GetOffset(), DW_TAG_value_to_name(die->Tag()), die->GetName(this, dwarf_cu)); - clang_type = ast.GetBuiltInType_objc_Class(); + clang_type = ast.GetBasicType(eBasicTypeObjCClass); encoding_data_type = Type::eEncodingIsUID; encoding_uid = LLDB_INVALID_UID; resolve_state = Type::eResolveStateFull; @@ -5809,7 +5788,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, die->GetOffset(), DW_TAG_value_to_name(die->Tag()), die->GetName(this, dwarf_cu)); - clang_type = ast.GetBuiltInType_objc_selector(); + clang_type = ast.GetBasicType(eBasicTypeObjCSel); encoding_data_type = Type::eEncodingIsUID; encoding_uid = LLDB_INVALID_UID; resolve_state = Type::eResolveStateFull; @@ -5832,7 +5811,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, die->GetOffset(), DW_TAG_value_to_name(die->Tag()), die->GetName(this, dwarf_cu)); - clang_type = ast.GetBuiltInType_objc_id(); + clang_type = ast.GetBasicType(eBasicTypeObjCID); encoding_data_type = Type::eEncodingIsUID; encoding_uid = LLDB_INVALID_UID; resolve_state = Type::eResolveStateFull; @@ -6109,8 +6088,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } assert (tag_decl_kind != -1); bool clang_type_was_created = false; - clang_type = m_forward_decl_die_to_clang_type.lookup (die); - if (clang_type == NULL) + clang_type.SetClangType(ast.getASTContext(), m_forward_decl_die_to_clang_type.lookup (die)); + if (!clang_type) { const DWARFDebugInfoEntry *decl_ctx_die; @@ -6166,7 +6145,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, // Store a forward declaration to this class type in case any // parameters in any class methods need it for the clang // types for function prototypes. - LinkDeclContextToDIE(ClangASTContext::GetDeclContextForType(clang_type), die); + LinkDeclContextToDIE(clang_type.GetDeclContextForType(), die); type_sp.reset (new Type (MakeUserID(die->GetOffset()), this, type_name_const_str, @@ -6202,27 +6181,21 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (die->HasChildren() == false) { // No children for this struct/union/class, lets finish it - ast.StartTagDeclarationDefinition (clang_type); - ast.CompleteTagDeclarationDefinition (clang_type); + clang_type.StartTagDeclarationDefinition (); + clang_type.CompleteTagDeclarationDefinition (); if (tag == DW_TAG_structure_type) // this only applies in C { - clang::QualType qual_type = clang::QualType::getFromOpaquePtr (clang_type); - const clang::RecordType *record_type = qual_type->getAs<clang::RecordType> (); + clang::RecordDecl *record_decl = clang_type.GetAsRecordDecl(); - if (record_type) + if (record_decl) { - clang::RecordDecl *record_decl = record_type->getDecl(); + LayoutInfo layout_info; - if (record_decl) - { - LayoutInfo layout_info; - - layout_info.alignment = 0; - layout_info.bit_size = 0; - - m_record_decl_to_layout_map.insert(std::make_pair(record_decl, layout_info)); - } + layout_info.alignment = 0; + layout_info.bit_size = 0; + + m_record_decl_to_layout_map.insert(std::make_pair(record_decl, layout_info)); } } } @@ -6238,16 +6211,16 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (class_language != eLanguageTypeObjC && class_language != eLanguageTypeObjC_plus_plus) - ast.StartTagDeclarationDefinition (clang_type); + clang_type.StartTagDeclarationDefinition (); // Leave this as a forward declaration until we need // to know the details of the type. lldb_private::Type // will automatically call the SymbolFile virtual function // "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition(Type *)" // When the definition needs to be defined. - m_forward_decl_die_to_clang_type[die] = clang_type; - m_forward_decl_clang_type_to_die[ClangASTType::RemoveFastQualifiers (clang_type)] = die; - ClangASTContext::SetHasExternalStorage (clang_type, true); + m_forward_decl_die_to_clang_type[die] = clang_type.GetOpaqueQualType(); + m_forward_decl_clang_type_to_die[clang_type.RemoveFastQualifiers().GetOpaqueQualType()] = die; + clang_type.SetHasExternalStorage (true); } } @@ -6303,9 +6276,9 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); - clang_type_t enumerator_clang_type = NULL; - clang_type = m_forward_decl_die_to_clang_type.lookup (die); - if (clang_type == NULL) + ClangASTType enumerator_clang_type; + clang_type.SetClangType (ast.getASTContext(), m_forward_decl_die_to_clang_type.lookup (die)); + if (!clang_type) { if (encoding_uid != DW_INVALID_OFFSET) { @@ -6314,7 +6287,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, enumerator_clang_type = enumerator_type->GetClangFullType(); } - if (enumerator_clang_type == NULL) + if (!enumerator_clang_type) enumerator_clang_type = ast.GetBuiltinTypeForDWARFEncodingAndBitSize (NULL, DW_ATE_signed, byte_size * 8); @@ -6326,10 +6299,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } else { - enumerator_clang_type = ClangASTContext::GetEnumerationIntegerType (clang_type); + enumerator_clang_type = clang_type.GetEnumerationIntegerType (); } - LinkDeclContextToDIE(ClangASTContext::GetDeclContextForType(clang_type), die); + LinkDeclContextToDIE(clang_type.GetDeclContextForType(), die); type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, @@ -6342,15 +6315,15 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, clang_type, Type::eResolveStateForward)); - ast.StartTagDeclarationDefinition (clang_type); + clang_type.StartTagDeclarationDefinition (); if (die->HasChildren()) { SymbolContext cu_sc(GetCompUnitForDWARFCompUnit(dwarf_cu)); bool is_signed = false; - ast.IsIntegerType(enumerator_clang_type, is_signed); + enumerator_clang_type.IsIntegerType(is_signed); ParseChildEnumerators(cu_sc, clang_type, is_signed, type_sp->GetByteSize(), dwarf_cu, die); } - ast.CompleteTagDeclarationDefinition (clang_type); + clang_type.CompleteTagDeclarationDefinition (); } } break; @@ -6473,7 +6446,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr); - clang_type_t return_clang_type = NULL; + ClangASTType return_clang_type; Type *func_type = NULL; if (type_die_offset != DW_INVALID_OFFSET) @@ -6482,10 +6455,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (func_type) return_clang_type = func_type->GetClangForwardType(); else - return_clang_type = ast.GetBuiltInType_void(); + return_clang_type = ast.GetBasicType(eBasicTypeVoid); - std::vector<clang_type_t> function_param_types; + std::vector<ClangASTType> function_param_types; std::vector<clang::ParmVarDecl*> function_param_decls; // Parse the function children for the parameters @@ -6535,7 +6508,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (objc_method.IsValid(true)) { SymbolContext empty_sc; - clang_type_t class_opaque_type = NULL; + ClangASTType class_opaque_type; ConstString class_name(objc_method.GetClassName()); if (class_name) { @@ -6544,8 +6517,8 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (complete_objc_class_type_sp) { - clang_type_t type_clang_forward_type = complete_objc_class_type_sp->GetClangForwardType(); - if (ClangASTContext::IsObjCClassType (type_clang_forward_type)) + ClangASTType type_clang_forward_type = complete_objc_class_type_sp->GetClangForwardType(); + if (type_clang_forward_type.IsObjCObjectOrInterfaceType ()) class_opaque_type = type_clang_forward_type; } } @@ -6557,11 +6530,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, if (accessibility == eAccessNone) accessibility = eAccessPublic; - clang::ObjCMethodDecl *objc_method_decl = ast.AddMethodToObjCObjectType (class_opaque_type, - type_name_cstr, - clang_type, - accessibility, - is_artificial); + clang::ObjCMethodDecl *objc_method_decl = class_opaque_type.AddMethodToObjCObjectType (type_name_cstr, + clang_type, + accessibility, + is_artificial); type_handled = objc_method_decl != NULL; if (type_handled) { @@ -6680,10 +6652,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, } else { - clang_type_t class_opaque_type = class_type->GetClangForwardType(); - if (ClangASTContext::IsCXXClassType (class_opaque_type)) + ClangASTType class_opaque_type = class_type->GetClangForwardType(); + if (class_opaque_type.IsCXXClassType ()) { - if (ClangASTContext::IsBeingDefined (class_opaque_type)) + if (class_opaque_type.IsBeingDefined ()) { // Neither GCC 4.2 nor clang++ currently set a valid accessibility // in the DWARF for C++ methods... Default to public for now... @@ -6709,16 +6681,15 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const bool is_attr_used = false; - cxx_method_decl = ast.AddMethodToCXXRecordType (class_opaque_type, - type_name_cstr, - clang_type, - accessibility, - is_virtual, - is_static, - is_inline, - is_explicit, - is_attr_used, - is_artificial); + cxx_method_decl = class_opaque_type.AddMethodToCXXRecordType (type_name_cstr, + clang_type, + accessibility, + is_virtual, + is_static, + is_inline, + is_explicit, + is_attr_used, + is_artificial); type_handled = cxx_method_decl != NULL; @@ -6902,7 +6873,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, ParseChildArrayInfo(sc, dwarf_cu, die, first_index, element_orders, byte_stride, bit_stride); if (byte_stride == 0 && bit_stride == 0) byte_stride = element_type->GetByteSize(); - clang_type_t array_element_type = element_type->GetClangForwardType(); + ClangASTType array_element_type = element_type->GetClangForwardType(); uint64_t array_element_bit_stride = byte_stride * 8 + bit_stride; uint64_t num_elements = 0; std::vector<uint64_t>::const_reverse_iterator pos; @@ -6961,14 +6932,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, Type *pointee_type = ResolveTypeUID(type_die_offset); Type *class_type = ResolveTypeUID(containing_type_die_offset); - clang_type_t pointee_clang_type = pointee_type->GetClangForwardType(); - clang_type_t class_clang_type = class_type->GetClangLayoutType(); + ClangASTType pointee_clang_type = pointee_type->GetClangForwardType(); + ClangASTType class_clang_type = class_type->GetClangLayoutType(); - clang_type = ast.CreateMemberPointerType(pointee_clang_type, - class_clang_type); + clang_type = pointee_clang_type.CreateMemberPointerType(class_clang_type); - byte_size = ClangASTType::GetClangTypeBitWidth (ast.getASTContext(), - clang_type) / 8; + byte_size = clang_type.GetByteSize(); type_sp.reset( new Type (MakeUserID(die->GetOffset()), this, @@ -7761,7 +7730,7 @@ void SymbolFileDWARF::CompleteTagDecl (void *baton, clang::TagDecl *decl) { SymbolFileDWARF *symbol_file_dwarf = (SymbolFileDWARF *)baton; - clang_type_t clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); + ClangASTType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); if (clang_type) symbol_file_dwarf->ResolveClangOpaqueTypeDefinition (clang_type); } @@ -7770,7 +7739,7 @@ void SymbolFileDWARF::CompleteObjCInterfaceDecl (void *baton, clang::ObjCInterfaceDecl *decl) { SymbolFileDWARF *symbol_file_dwarf = (SymbolFileDWARF *)baton; - clang_type_t clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); + ClangASTType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); if (clang_type) symbol_file_dwarf->ResolveClangOpaqueTypeDefinition (clang_type); } @@ -7844,8 +7813,7 @@ SymbolFileDWARF::SearchDeclContext (const clang::DeclContext *decl_context, Type *matching_type = ResolveType (dwarf_cu, die); - lldb::clang_type_t type = matching_type->GetClangForwardType(); - clang::QualType qual_type = clang::QualType::getFromOpaquePtr(type); + clang::QualType qual_type = matching_type->GetClangForwardType().GetQualType(); if (const clang::TagType *tag_type = llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr())) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 0370bc3f595..b6c6d94782d 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -107,7 +107,7 @@ public: virtual size_t ParseVariablesForContext (const lldb_private::SymbolContext& sc); virtual lldb_private::Type* ResolveTypeUID(lldb::user_id_t type_uid); - virtual lldb::clang_type_t ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_opaque_type); + virtual bool ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_type); virtual lldb_private::Type* ResolveType (DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry* type_die, bool assert_not_being_parsed = true); virtual clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid); @@ -275,7 +275,7 @@ public: } bool - HasForwardDeclForClangType (lldb::clang_type_t clang_type); + HasForwardDeclForClangType (const lldb_private::ClangASTType &clang_type); protected: @@ -347,7 +347,7 @@ protected: const lldb_private::SymbolContext& sc, DWARFCompileUnit* dwarf_cu, const DWARFDebugInfoEntry *die, - lldb::clang_type_t class_clang_type, + lldb_private::ClangASTType &class_clang_type, const lldb::LanguageType class_language, std::vector<clang::CXXBaseSpecifier *>& base_classes, std::vector<int>& member_accessibilities, @@ -365,14 +365,14 @@ protected: bool skip_artificial, bool &is_static, lldb_private::TypeList* type_list, - std::vector<lldb::clang_type_t>& function_args, + std::vector<lldb_private::ClangASTType>& function_args, std::vector<clang::ParmVarDecl*>& function_param_decls, unsigned &type_quals, lldb_private::ClangASTContext::TemplateParameterInfos &template_param_infos); size_t ParseChildEnumerators( const lldb_private::SymbolContext& sc, - lldb::clang_type_t enumerator_qual_type, + lldb_private::ClangASTType &clang_type, bool is_signed, uint32_t enumerator_byte_size, DWARFCompileUnit* dwarf_cu, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 42107efe0aa..a0430e3d52b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -780,11 +780,11 @@ SymbolFileDWARFDebugMap::ResolveTypeUID(lldb::user_id_t type_uid) return NULL; } -lldb::clang_type_t -SymbolFileDWARFDebugMap::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type) +bool +SymbolFileDWARFDebugMap::ResolveClangOpaqueTypeDefinition (ClangASTType& clang_type) { // We have a struct/union/class/enum that needs to be fully resolved. - return NULL; + return false; } uint32_t @@ -1385,7 +1385,7 @@ void SymbolFileDWARFDebugMap::CompleteTagDecl (void *baton, clang::TagDecl *decl) { SymbolFileDWARFDebugMap *symbol_file_dwarf = (SymbolFileDWARFDebugMap *)baton; - clang_type_t clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); + ClangASTType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); if (clang_type) { SymbolFileDWARF *oso_dwarf; @@ -1405,7 +1405,7 @@ void SymbolFileDWARFDebugMap::CompleteObjCInterfaceDecl (void *baton, clang::ObjCInterfaceDecl *decl) { SymbolFileDWARFDebugMap *symbol_file_dwarf = (SymbolFileDWARFDebugMap *)baton; - clang_type_t clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); + ClangASTType clang_type = symbol_file_dwarf->GetClangASTContext().GetTypeForDecl (decl); if (clang_type) { SymbolFileDWARF *oso_dwarf; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index d38bf66725a..06330b98dc1 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -77,7 +77,7 @@ public: virtual lldb_private::Type* ResolveTypeUID (lldb::user_id_t type_uid); virtual clang::DeclContext* GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid); virtual clang::DeclContext* GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid); - virtual lldb::clang_type_t ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type); + virtual bool ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_type); virtual uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc); virtual uint32_t ResolveSymbolContext (const lldb_private::FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, lldb_private::SymbolContextList& sc_list); virtual uint32_t FindGlobalVariables (const lldb_private::ConstString &name, const lldb_private::ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, lldb_private::VariableList& variables); diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp index 28078693b35..9beba517ec8 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -292,10 +292,10 @@ SymbolFileSymtab::ResolveTypeUID(lldb::user_id_t type_uid) return NULL; } -lldb::clang_type_t -SymbolFileSymtab::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type) +bool +SymbolFileSymtab::ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_opaque_type) { - return NULL; + return false; } ClangNamespaceDecl diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h index 99f0eb16c60..914efe6eb3c 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h @@ -78,8 +78,8 @@ public: virtual lldb_private::Type* ResolveTypeUID(lldb::user_id_t type_uid); - virtual lldb::clang_type_t - ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_Type); + virtual bool + ResolveClangOpaqueTypeDefinition (lldb_private::ClangASTType& clang_type); virtual uint32_t ResolveSymbolContext (const lldb_private::Address& so_addr, uint32_t resolve_scope, lldb_private::SymbolContext& sc); |