forked from OSchip/llvm-project
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:
parent
4826c8fbe8
commit
e908a7a92c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue