Fixed the auto completion of objective C types with the new ExternalASTSource

changes that recently happened.

llvm-svn: 123881
This commit is contained in:
Greg Clayton 2011-01-20 04:18:48 +00:00
parent 511315cc55
commit c432c1967b
2 changed files with 25 additions and 11 deletions

View File

@ -2370,6 +2370,7 @@
isa = PBXProject;
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,

View File

@ -118,8 +118,9 @@ GetCompleteQualType (clang::ASTContext *ast, clang::QualType qual_type)
external_ast_source->CompleteType (class_interface_decl);
is_forward_decl = class_interface_decl->isForwardDecl();
}
return is_forward_decl == false;
}
return is_forward_decl;
return true;
}
}
break;
@ -1056,7 +1057,7 @@ ClangASTContext::SetHasExternalStorage (clang_type_t clang_type, bool has_extern
if (cxx_record_decl)
{
cxx_record_decl->setHasExternalLexicalStorage (has_extern);
//cxx_record_decl->setHasExternalVisibleStorage (has_extern);
cxx_record_decl->setHasExternalVisibleStorage (has_extern);
return true;
}
}
@ -1068,7 +1069,7 @@ ClangASTContext::SetHasExternalStorage (clang_type_t clang_type, bool has_extern
if (enum_decl)
{
enum_decl->setHasExternalLexicalStorage (has_extern);
//enum_decl->setHasExternalVisibleStorage (has_extern);
enum_decl->setHasExternalVisibleStorage (has_extern);
return true;
}
}
@ -1086,7 +1087,7 @@ ClangASTContext::SetHasExternalStorage (clang_type_t clang_type, bool has_extern
if (class_interface_decl)
{
class_interface_decl->setHasExternalLexicalStorage (has_extern);
//class_interface_decl->setHasExternalVisibleStorage (has_extern);
class_interface_decl->setHasExternalVisibleStorage (has_extern);
return true;
}
}
@ -1459,7 +1460,16 @@ ClangASTContext::AddMethodToCXXRecordType
cxx_method_decl->setParams (params, num_params);
cxx_record_decl->addDecl (cxx_method_decl);
// printf ("decl->isPolymorphic() = %i\n", cxx_record_decl->isPolymorphic());
// printf ("decl->isAggregate() = %i\n", cxx_record_decl->isAggregate());
// printf ("decl->isPOD() = %i\n", cxx_record_decl->isPOD());
// printf ("decl->isEmpty() = %i\n", cxx_record_decl->isEmpty());
// printf ("decl->isAbstract() = %i\n", cxx_record_decl->isAbstract());
// printf ("decl->hasTrivialConstructor() = %i\n", cxx_record_decl->hasTrivialConstructor());
// printf ("decl->hasTrivialCopyConstructor() = %i\n", cxx_record_decl->hasTrivialCopyConstructor());
// printf ("decl->hasTrivialCopyAssignment() = %i\n", cxx_record_decl->hasTrivialCopyAssignment());
// printf ("decl->hasTrivialDestructor() = %i\n", cxx_record_decl->hasTrivialDestructor());
return cxx_method_decl;
}
@ -2120,7 +2130,7 @@ ClangASTContext::GetNumChildren (clang::ASTContext *ast, clang_type_t clang_type
case clang::Type::Complex: return 0;
case clang::Type::Record:
if (ClangASTContext::GetCompleteType (ast, clang_type))
if (GetCompleteQualType (ast, qual_type))
{
const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
const RecordDecl *record_decl = record_type->getDecl();
@ -2163,6 +2173,7 @@ ClangASTContext::GetNumChildren (clang::ASTContext *ast, clang_type_t clang_type
case clang::Type::ObjCObject:
case clang::Type::ObjCInterface:
if (GetCompleteQualType (ast, qual_type))
{
ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
assert (objc_class_type);
@ -2427,7 +2438,7 @@ ClangASTContext::GetChildClangTypeAtIndex
break;
case clang::Type::Record:
if (ClangASTContext::GetCompleteType (ast, parent_clang_type))
if (GetCompleteQualType (ast, parent_qual_type))
{
const RecordType *record_type = cast<RecordType>(parent_qual_type.getTypePtr());
const RecordDecl *record_decl = record_type->getDecl();
@ -2517,6 +2528,7 @@ ClangASTContext::GetChildClangTypeAtIndex
case clang::Type::ObjCObject:
case clang::Type::ObjCInterface:
if (GetCompleteQualType (ast, parent_qual_type))
{
ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(parent_qual_type.getTypePtr());
assert (objc_class_type);
@ -2958,7 +2970,7 @@ ClangASTContext::GetIndexOfChildMemberWithName
switch (type_class)
{
case clang::Type::Record:
if (ClangASTContext::GetCompleteType (ast, clang_type))
if (GetCompleteQualType (ast, qual_type))
{
const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
const RecordDecl *record_decl = record_type->getDecl();
@ -3047,6 +3059,7 @@ ClangASTContext::GetIndexOfChildMemberWithName
case clang::Type::ObjCObject:
case clang::Type::ObjCInterface:
if (GetCompleteQualType (ast, qual_type))
{
StringRef name_sref(name);
ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
@ -3238,7 +3251,7 @@ ClangASTContext::GetIndexOfChildWithName
switch (type_class)
{
case clang::Type::Record:
if (ClangASTContext::GetCompleteType (ast, clang_type))
if (GetCompleteQualType (ast, qual_type))
{
const RecordType *record_type = cast<RecordType>(qual_type.getTypePtr());
const RecordDecl *record_decl = record_type->getDecl();
@ -3282,6 +3295,7 @@ ClangASTContext::GetIndexOfChildWithName
case clang::Type::ObjCObject:
case clang::Type::ObjCInterface:
if (GetCompleteQualType (ast, qual_type))
{
StringRef name_sref(name);
ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
@ -4354,8 +4368,7 @@ ClangASTContext::GetCompleteType (clang::ASTContext *ast, lldb::clang_type_t cla
if (clang_type == NULL)
return false;
clang::QualType qual_type(clang::QualType::getFromOpaquePtr(clang_type));
return GetCompleteQualType (ast, qual_type);
return GetCompleteQualType (ast, clang::QualType::getFromOpaquePtr(clang_type));
}