const char *property_setter_name,
const char *property_getter_name,
uint32_t property_attributes,
- const ClangASTMetadata *metadata
+ const ClangASTMetadata *metadata
) :
m_ast (ast),
m_class_opaque_type (class_opaque_type),
if (metadata != NULL)
{
m_metadata_ap.reset(new ClangASTMetadata());
- *(m_metadata_ap.get()) = *metadata;
+ *m_metadata_ap = *metadata;
}
}
if (rhs.m_metadata_ap.get())
{
m_metadata_ap.reset (new ClangASTMetadata());
- *(m_metadata_ap.get()) = *(rhs.m_metadata_ap.get());
+ *m_metadata_ap = *rhs.m_metadata_ap;
}
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());
+ 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());
}
private:
clang::ASTContext *m_ast;
const char *m_property_setter_name;
const char *m_property_getter_name;
uint32_t m_property_attributes;
- std::auto_ptr<ClangASTMetadata> m_metadata_ap;
+ std::auto_ptr<ClangASTMetadata> m_metadata_ap;
};
struct BitfieldInfo
}
};
+
+bool
+SymbolFileDWARF::ClassOrStructIsVirtual (DWARFCompileUnit* dwarf_cu,
+ const DWARFDebugInfoEntry *parent_die)
+{
+ if (parent_die)
+ {
+ for (const DWARFDebugInfoEntry *die = parent_die->GetFirstChild(); die != NULL; die = die->GetSibling())
+ {
+ dw_tag_t tag = die->Tag();
+ bool check_virtuality = false;
+ switch (tag)
+ {
+ case DW_TAG_inheritance:
+ case DW_TAG_subprogram:
+ check_virtuality = true;
+ break;
+ default:
+ break;
+ }
+ if (check_virtuality)
+ {
+ if (die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_virtuality, 0) != 0)
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
size_t
SymbolFileDWARF::ParseChildMembers
(
accessibility = default_accessibility;
}
+ ClangASTMetadata metadata;
+ metadata.SetUserID(MakeUserID(die->GetOffset()));
+ metadata.SetIsDynamicCXXType(ClassOrStructIsVirtual (dwarf_cu, die));
+
if (type_name_cstr && strchr (type_name_cstr, '<'))
{
ClangASTContext::TemplateParameterInfos template_param_infos;
clang_type = ast.CreateClassTemplateSpecializationType (class_specialization_decl);
clang_type_was_created = true;
- GetClangASTContext().SetMetadataAsUserID ((uintptr_t)class_template_decl, MakeUserID(die->GetOffset()));
- GetClangASTContext().SetMetadataAsUserID ((uintptr_t)class_specialization_decl, MakeUserID(die->GetOffset()));
+ GetClangASTContext().SetMetadata ((uintptr_t)class_template_decl, metadata);
+ GetClangASTContext().SetMetadata ((uintptr_t)class_specialization_decl, metadata);
}
}
if (!clang_type_was_created)
{
clang_type_was_created = true;
- ClangASTMetadata metadata;
- metadata.SetUserID(MakeUserID(die->GetOffset()));
clang_type = ast.CreateRecordType (decl_ctx,
accessibility,
type_name_cstr,
#pragma mark Structure, Unions, Classes
clang_type_t
-ClangASTContext::CreateRecordType (DeclContext *decl_ctx, AccessType access_type, const char *name, int kind, LanguageType language, ClangASTMetadata *metadata)
+ClangASTContext::CreateRecordType (DeclContext *decl_ctx,
+ AccessType access_type,
+ const char *name,
+ int kind,
+ LanguageType language,
+ ClangASTMetadata *metadata)
{
ASTContext *ast = getASTContext();
assert (ast != NULL);
SourceLocation(),
name && name[0] ? &ast->Idents.get(name) : NULL);
- if (decl && metadata)
- SetMetadata(ast, (uintptr_t)decl, *metadata);
-
- if (decl_ctx)
+ if (decl)
{
+ if (metadata)
+ SetMetadata(ast, (uintptr_t)decl, *metadata);
+
if (access_type != eAccessNone)
decl->setAccess (ConvertAccessTypeToAccessSpecifier (access_type));
- decl_ctx->addDecl (decl);
+
+ if (decl_ctx)
+ decl_ctx->addDecl (decl);
+
+ return ast->getTagDeclType(decl).getAsOpaquePtr();
}
- return ast->getTagDeclType(decl).getAsOpaquePtr();
+ return NULL;
}
static TemplateParameterList *
if (cxx_record_decl)
{
bool is_complete = cxx_record_decl->isCompleteDefinition();
- if (!is_complete)
- is_complete = ClangASTContext::GetCompleteType (ast, pointee_qual_type.getAsOpaquePtr());
-
+
if (is_complete)
- {
success = cxx_record_decl->isDynamicClass();
- }
else
{
- success = false;
+ ClangASTMetadata *metadata = GetMetadata (ast, (uintptr_t)cxx_record_decl);
+ if (metadata)
+ success = metadata->GetIsDynamicCXXType();
+ else
+ {
+ is_complete = ClangASTContext::GetCompleteType (ast, pointee_qual_type.getAsOpaquePtr());
+ if (is_complete)
+ success = cxx_record_decl->isDynamicClass();
+ else
+ success = false;
+ }
}
if (success)