Make forward declarations for objective-c types use the new

temporary forward declaration nodes. Fixes a problem building
Chrome.

llvm-svn: 150976
This commit is contained in:
Eric Christopher 2012-02-20 18:05:04 +00:00
parent 4826c8fbe8
commit e908a7a92c
1 changed files with 14 additions and 17 deletions

View File

@ -336,21 +336,19 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
case BuiltinType::Void:
return llvm::DIType();
case BuiltinType::ObjCClass:
return DBuilder.createStructType(TheCU, "objc_class",
getOrCreateMainFile(), 0, 0, 0,
llvm::DIDescriptor::FlagFwdDecl,
llvm::DIArray());
return DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
"objc_class", getOrCreateMainFile(),
0);
case BuiltinType::ObjCId: {
// typedef struct objc_class *Class;
// typedef struct objc_object {
// Class isa;
// } *id;
llvm::DIType OCTy =
DBuilder.createStructType(TheCU, "objc_class",
getOrCreateMainFile(), 0, 0, 0,
llvm::DIDescriptor::FlagFwdDecl,
llvm::DIArray());
llvm::DIType OCTy =
DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
"objc_class", getOrCreateMainFile(),
0);
unsigned Size = CGM.getContext().getTypeSize(CGM.getContext().VoidPtrTy);
llvm::DIType ISATy = DBuilder.createPointerType(OCTy, Size);
@ -368,10 +366,10 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
0, 0, 0, 0, Elements);
}
case BuiltinType::ObjCSel: {
return DBuilder.createStructType(TheCU, "objc_selector",
getOrCreateMainFile(), 0, 0, 0,
llvm::DIDescriptor::FlagFwdDecl,
llvm::DIArray());
return
DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
"objc_selector", getOrCreateMainFile(),
0);
}
case BuiltinType::UChar:
case BuiltinType::Char_U: Encoding = llvm::dwarf::DW_ATE_unsigned_char; break;
@ -1224,10 +1222,9 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
ObjCInterfaceDecl *Def = ID->getDefinition();
if (!Def) {
llvm::DIType FwdDecl =
DBuilder.createStructType(Unit, ID->getName(),
DefUnit, Line, 0, 0,
llvm::DIDescriptor::FlagFwdDecl,
llvm::DIArray(), RuntimeLang);
DBuilder.createForwardDecl(llvm::dwarf::DW_TAG_structure_type,
ID->getName(), DefUnit, Line,
RuntimeLang);
return FwdDecl;
}
ID = Def;