forked from OSchip/llvm-project
Strangely enough, name of ObjC class is not encoded into the
full encoding of the class which has an ivar of pointer to this class. Its name is encoded in the type for the ivar in the ivar-list metadata. This patch conforms to the above rule. llvm-svn: 61282
This commit is contained in:
parent
ab316350bf
commit
7acf0749d4
|
@ -1795,10 +1795,12 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
|
|||
}
|
||||
else if (PointeeTy->isObjCInterfaceType()) {
|
||||
S += '@';
|
||||
ObjCInterfaceDecl *OI = PointeeTy->getAsObjCInterfaceType()->getDecl();
|
||||
S += '"';
|
||||
S += OI->getNameAsCString();
|
||||
S += '"';
|
||||
if (FD) {
|
||||
ObjCInterfaceDecl *OI = PointeeTy->getAsObjCInterfaceType()->getDecl();
|
||||
S += '"';
|
||||
S += OI->getNameAsCString();
|
||||
S += '"';
|
||||
}
|
||||
return;
|
||||
} else if (isObjCClassType(PointeeTy)) {
|
||||
S += '#';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// RUN: clang -fnext-runtime -emit-llvm -o %t %s &&
|
||||
// RUN: grep -e "\^{Innermost=CC}" %t | count 1 &&
|
||||
// RUN: grep -e "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}" %t | count 1
|
||||
// RUN: grep -e "{Derived=#ib32b8b3b8sb16b8b8b2b8ccb6}" %t | count 1 &&
|
||||
// RUN: grep -e "{B1=#@c}" %t | count 1
|
||||
|
||||
@class Int1;
|
||||
|
||||
|
@ -48,8 +49,20 @@ struct Innermost {
|
|||
@implementation Derived
|
||||
@end
|
||||
|
||||
@interface B1
|
||||
{
|
||||
struct objc_class *isa;
|
||||
Int1 *sBase;
|
||||
char c;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation B1
|
||||
@end
|
||||
|
||||
int main()
|
||||
{
|
||||
const char *en = @encode(Derived);
|
||||
const char *eb = @encode(B1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue