diff options
Diffstat (limited to 'lldb/source/Symbol')
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 0262d3d8e4b..1d7063b4ebb 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -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, |

