diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-02-21 20:42:11 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-02-21 20:42:11 +0000 |
commit | 05f8ff134d5f270bd7bfe4aaef491bd3febddea1 (patch) | |
tree | 64e6fc149feee17cfcda0e2651ace7b53d28e504 /lib/CodeGen | |
parent | 51d1095adfffe294780cd60a96a67e04d9a0b64e (diff) |
Patch for debug info of qualified-id types is 'id'
By Adrian Pranti.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index a4153d3712..10b21ccda3 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -530,6 +530,13 @@ llvm::DIType CGDebugInfo::CreateQualifiedType(QualType Ty, llvm::DIFile Unit) { llvm::DIType CGDebugInfo::CreateType(const ObjCObjectPointerType *Ty, llvm::DIFile Unit) { + + // The frontend treats 'id' as a typedef to an ObjCObjectType, + // whereas 'id<protocol>' is treated as an ObjCPointerType. For the + // debug info, we want to emit 'id' in both cases. + if (Ty->isObjCQualifiedIdType()) + return getOrCreateType(CGM.getContext().getObjCIdType(), Unit); + llvm::DIType DbgTy = CreatePointerLikeType(llvm::dwarf::DW_TAG_pointer_type, Ty, Ty->getPointeeType(), Unit); @@ -618,7 +625,6 @@ llvm::DIType CGDebugInfo::CreatePointeeType(QualType PointeeTy, return RetTy; } return getOrCreateType(PointeeTy, Unit); - } llvm::DIType CGDebugInfo::CreatePointerLikeType(unsigned Tag, @@ -629,7 +635,7 @@ llvm::DIType CGDebugInfo::CreatePointerLikeType(unsigned Tag, Tag == llvm::dwarf::DW_TAG_rvalue_reference_type) return DBuilder.createReferenceType(Tag, CreatePointeeType(PointeeTy, Unit)); - + // Bit size, align and offset of the type. // Size is always the size of a pointer. We can't use getTypeSize here // because that does not return the correct value for references. |