forked from OSchip/llvm-project
We now record metadata for Objective-C interfaces,
Objective-C methods, and Objective-C properties. llvm-svn: 154972
This commit is contained in:
parent
3d013bccfa
commit
ad880767fc
|
@ -291,7 +291,7 @@ public:
|
|||
const char *name,
|
||||
int kind,
|
||||
lldb::LanguageType language,
|
||||
clang::CXXRecordDecl **decl = NULL);
|
||||
uint64_t metadata = 0);
|
||||
|
||||
static clang::FieldDecl *
|
||||
AddFieldToRecordType (clang::ASTContext *ast,
|
||||
|
@ -449,7 +449,8 @@ public:
|
|||
CreateObjCClass (const char *name,
|
||||
clang::DeclContext *decl_ctx,
|
||||
bool isForwardDecl,
|
||||
bool isInternal);
|
||||
bool isInternal,
|
||||
uint64_t metadata = 0);
|
||||
|
||||
static clang::FieldDecl *
|
||||
AddObjCClassIVar (clang::ASTContext *ast,
|
||||
|
@ -487,7 +488,8 @@ public:
|
|||
clang::ObjCIvarDecl *ivar_decl,
|
||||
const char *property_setter_name,
|
||||
const char *property_getter_name,
|
||||
uint32_t property_attributes
|
||||
uint32_t property_attributes,
|
||||
uint64_t metadata = 0
|
||||
);
|
||||
|
||||
bool
|
||||
|
@ -499,7 +501,8 @@ public:
|
|||
clang::ObjCIvarDecl *ivar_decl,
|
||||
const char *property_setter_name,
|
||||
const char *property_getter_name,
|
||||
uint32_t property_attributes
|
||||
uint32_t property_attributes,
|
||||
uint64_t metadata = 0
|
||||
)
|
||||
{
|
||||
return ClangASTContext::AddObjCClassProperty (getASTContext(),
|
||||
|
@ -509,7 +512,8 @@ public:
|
|||
ivar_decl,
|
||||
property_setter_name,
|
||||
property_getter_name,
|
||||
property_attributes);
|
||||
property_attributes,
|
||||
metadata);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -1737,9 +1737,11 @@ SymbolFileDWARF::ParseChildMembers
|
|||
ivar_decl,
|
||||
prop_setter_name,
|
||||
prop_getter_name,
|
||||
prop_attributes);
|
||||
prop_attributes,
|
||||
MakeUserID(die->GetOffset()));
|
||||
|
||||
GetClangASTContext().SetMetadata((uintptr_t)ivar_decl, MakeUserID(die->GetOffset()));
|
||||
if (ivar_decl)
|
||||
GetClangASTContext().SetMetadata((uintptr_t)ivar_decl, MakeUserID(die->GetOffset()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5176,14 +5178,12 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
|
|||
if (!clang_type_was_created)
|
||||
{
|
||||
clang_type_was_created = true;
|
||||
clang::CXXRecordDecl *record_decl;
|
||||
clang_type = ast.CreateRecordType (decl_ctx,
|
||||
accessibility,
|
||||
type_name_cstr,
|
||||
tag_decl_kind,
|
||||
class_language,
|
||||
&record_decl);
|
||||
GetClangASTContext().SetMetadata((uintptr_t)record_decl, MakeUserID(die->GetOffset()));
|
||||
MakeUserID(die->GetOffset()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -407,7 +407,8 @@ SymbolFileSymtab::FindTypes (const lldb_private::SymbolContext& sc,
|
|||
lldb::clang_type_t objc_object_type = ast.CreateObjCClass (name.AsCString(),
|
||||
ast.GetTranslationUnitDecl(),
|
||||
isForwardDecl,
|
||||
isInternal);
|
||||
isInternal,
|
||||
0xffaaffaaffaaffaall);
|
||||
|
||||
Declaration decl;
|
||||
|
||||
|
|
|
@ -1125,14 +1125,11 @@ ClangASTContext::GetTypeForDecl (ObjCInterfaceDecl *decl)
|
|||
#pragma mark Structure, Unions, Classes
|
||||
|
||||
clang_type_t
|
||||
ClangASTContext::CreateRecordType (DeclContext *decl_ctx, AccessType access_type, const char *name, int kind, LanguageType language, CXXRecordDecl **out_decl)
|
||||
ClangASTContext::CreateRecordType (DeclContext *decl_ctx, AccessType access_type, const char *name, int kind, LanguageType language, uint64_t metadata)
|
||||
{
|
||||
ASTContext *ast = getASTContext();
|
||||
assert (ast != NULL);
|
||||
|
||||
if (out_decl)
|
||||
*out_decl = NULL;
|
||||
|
||||
|
||||
if (decl_ctx == NULL)
|
||||
decl_ctx = ast->getTranslationUnitDecl();
|
||||
|
||||
|
@ -1141,7 +1138,7 @@ ClangASTContext::CreateRecordType (DeclContext *decl_ctx, AccessType access_type
|
|||
{
|
||||
bool isForwardDecl = true;
|
||||
bool isInternal = false;
|
||||
return CreateObjCClass (name, decl_ctx, isForwardDecl, isInternal);
|
||||
return CreateObjCClass (name, decl_ctx, isForwardDecl, isInternal, metadata);
|
||||
}
|
||||
|
||||
// NOTE: Eventually CXXRecordDecl will be merged back into RecordDecl and
|
||||
|
@ -1156,8 +1153,8 @@ ClangASTContext::CreateRecordType (DeclContext *decl_ctx, AccessType access_type
|
|||
SourceLocation(),
|
||||
name && name[0] ? &ast->Idents.get(name) : NULL);
|
||||
|
||||
if (out_decl)
|
||||
*out_decl = decl;
|
||||
if (decl)
|
||||
SetMetadata(ast, (uintptr_t)decl, metadata);
|
||||
|
||||
if (!name)
|
||||
decl->setAnonymousStructOrUnion(true);
|
||||
|
@ -2251,12 +2248,13 @@ ClangASTContext::SetBaseClassesForClassType (clang_type_t class_clang_type, CXXB
|
|||
#pragma mark Objective C Classes
|
||||
|
||||
clang_type_t
|
||||
ClangASTContext::CreateObjCClass
|
||||
ClangASTContext::CreateObjCClass
|
||||
(
|
||||
const char *name,
|
||||
DeclContext *decl_ctx,
|
||||
bool isForwardDecl,
|
||||
bool isInternal
|
||||
bool isInternal,
|
||||
uint64_t metadata
|
||||
)
|
||||
{
|
||||
ASTContext *ast = getASTContext();
|
||||
|
@ -2279,6 +2277,9 @@ ClangASTContext::CreateObjCClass
|
|||
/*isForwardDecl,*/
|
||||
isInternal);
|
||||
|
||||
if (decl)
|
||||
SetMetadata(ast, (uintptr_t)decl, metadata);
|
||||
|
||||
return ast->getObjCInterfaceType(decl).getAsOpaquePtr();
|
||||
}
|
||||
|
||||
|
@ -2390,7 +2391,8 @@ ClangASTContext::AddObjCClassProperty
|
|||
ObjCIvarDecl *ivar_decl,
|
||||
const char *property_setter_name,
|
||||
const char *property_getter_name,
|
||||
uint32_t property_attributes
|
||||
uint32_t property_attributes,
|
||||
uint64_t metadata
|
||||
)
|
||||
{
|
||||
if (class_opaque_type == NULL || property_name == NULL || property_name[0] == '\0')
|
||||
|
@ -2434,8 +2436,11 @@ ClangASTContext::AddObjCClassProperty
|
|||
SourceLocation(), //Source location for (
|
||||
prop_type_source
|
||||
);
|
||||
|
||||
if (property_decl)
|
||||
{
|
||||
SetMetadata(ast, (uintptr_t)property_decl, metadata);
|
||||
|
||||
class_interface_decl->addDecl (property_decl);
|
||||
|
||||
Selector setter_sel, getter_sel;
|
||||
|
@ -2512,6 +2517,9 @@ ClangASTContext::AddObjCClassProperty
|
|||
isDefined,
|
||||
impControl,
|
||||
HasRelatedResultType);
|
||||
|
||||
if (getter)
|
||||
SetMetadata(ast, (uintptr_t)getter, metadata);
|
||||
|
||||
getter->setMethodParams(*ast, ArrayRef<ParmVarDecl*>(), ArrayRef<SourceLocation>());
|
||||
|
||||
|
@ -2545,6 +2553,9 @@ ClangASTContext::AddObjCClassProperty
|
|||
impControl,
|
||||
HasRelatedResultType);
|
||||
|
||||
if (setter)
|
||||
SetMetadata(ast, (uintptr_t)setter, metadata);
|
||||
|
||||
llvm::SmallVector<ParmVarDecl *, 1> params;
|
||||
|
||||
params.push_back (ParmVarDecl::Create (*ast,
|
||||
|
|
Loading…
Reference in New Issue