]> granicus.if.org Git - clang/commitdiff
Fixed an ICE in meta-data generation of __weak/__strong ivars.
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 21 Feb 2009 18:23:24 +0000 (18:23 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 21 Feb 2009 18:23:24 +0000 (18:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65235 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/CodeGenObjC/objc2-weak-ivar.m [new file with mode: 0644]

index 4a84e3d66ca8891bec1ef16242a6d42229cca2d2..830cc6a977e24c1a26b09b86c90c108d3797df43 100644 (file)
@@ -2151,7 +2151,8 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
       }
       S += '@';
       if (FD || EncodingProperty) {
-        const ObjCInterfaceType *OIT = PointeeTy->getAsObjCInterfaceType();
+        const ObjCInterfaceType *OIT = 
+                PointeeTy.getUnqualifiedType()->getAsObjCInterfaceType();
         ObjCInterfaceDecl *OI = OIT->getDecl();
         S += '"';
         S += OI->getNameAsCString();
diff --git a/test/CodeGenObjC/objc2-weak-ivar.m b/test/CodeGenObjC/objc2-weak-ivar.m
new file mode 100644 (file)
index 0000000..611bffd
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: clang -triple x86_64-unknown-unknown -fobjc-gc -emit-llvm -o %t %s
+@class NSObject;
+
+@interface Foo  {
+@public
+  __weak NSObject *nsobject;
+}
+@end
+
+@implementation Foo @end