[cfe-commits] r67402 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/forward-class-impl-metadata.m
Fariborz Jahanian
fjahanian at apple.com
Fri Mar 20 13:48:19 PDT 2009
Author: fjahanian
Date: Fri Mar 20 15:48:19 2009
New Revision: 67402
URL: http://llvm.org/viewvc/llvm-project?rev=67402&view=rev
Log:
Fix a crash during meta-data generation of objc2's nonfragile abi.
Added:
cfe/trunk/test/CodeGenObjC/forward-class-impl-metadata.m
Modified:
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=67402&r1=67401&r2=67402&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Fri Mar 20 15:48:19 2009
@@ -4193,7 +4193,10 @@
ID->getClassInterface()->getSuperClass()->getNameAsString();
SuperClassGV = GetClassGlobal(ObjCClassName + RootClassName);
}
-
+ // FIXME: Gross
+ ObjCInterfaceDecl *Interface =
+ const_cast<ObjCInterfaceDecl*>(ID->getClassInterface());
+ CGM.getTypes().ConvertType(CGM.getContext().buildObjCInterfaceType(Interface));
InstanceStart = InstanceSize = 0;
if (ObjCInterfaceDecl *OID =
const_cast<ObjCInterfaceDecl*>(ID->getClassInterface())) {
Added: cfe/trunk/test/CodeGenObjC/forward-class-impl-metadata.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/forward-class-impl-metadata.m?rev=67402&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/forward-class-impl-metadata.m (added)
+++ cfe/trunk/test/CodeGenObjC/forward-class-impl-metadata.m Fri Mar 20 15:48:19 2009
@@ -0,0 +1,24 @@
+// RUN: clang -triple x86_64-unknown-unknown -emit-llvm -o %t %s
+
+ at interface BASE {
+ at private
+ void* _reserved;
+}
+ at end
+
+ at class PVR;
+
+ at interface PVRHandldler
+{
+ PVR *_imageBrowser;
+}
+ at end
+
+ at implementation PVRHandldler @end
+
+
+ at interface PVR : BASE
+ at end
+
+ at implementation PVR
+ at end
More information about the cfe-commits
mailing list