forked from OSchip/llvm-project
Fixes a regression in generating objc's GC API
in assiging to c pointer types with a GC'able attribute. llvm-svn: 81244
This commit is contained in:
parent
10ff0c1862
commit
b17a190186
|
@ -2235,6 +2235,9 @@ inline QualType::GCAttrTypes QualType::getObjCGCAttr() const {
|
|||
return EXTQT->getObjCGCAttr();
|
||||
if (const ObjCObjectPointerType *PT = CT->getAsObjCObjectPointerType())
|
||||
return PT->getPointeeType().getObjCGCAttr();
|
||||
// We most look at all pointer types, not just pointer to interface types.
|
||||
if (const PointerType *PT = CT->getAs<PointerType>())
|
||||
return PT->getPointeeType().getObjCGCAttr();
|
||||
return GCNone;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s &&
|
||||
// RUN: grep objc_assign_strongCast %t | count 3 &&
|
||||
// RUN: true
|
||||
|
||||
struct Slice {
|
||||
void *__strong * items;
|
||||
};
|
||||
|
||||
typedef struct Slice Slice;
|
||||
|
||||
@interface ISlice {
|
||||
@public
|
||||
void *__strong * items;
|
||||
}
|
||||
@end
|
||||
|
||||
void foo () {
|
||||
Slice *slice;
|
||||
slice->items = 0;
|
||||
|
||||
ISlice *islice;
|
||||
islice->items = 0;
|
||||
}
|
Loading…
Reference in New Issue