[cfe-commits] r65666 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Feb 27 16:54:00 PST 2009


Author: fjahanian
Date: Fri Feb 27 18:54:00 2009
New Revision: 65666

URL: http://llvm.org/viewvc/llvm-project?rev=65666&view=rev
Log:
Alignment of pointers in __objc_classlist must be on their
natural alignment. Otherwise, the excess hole confuses the
objc2 runtime (this is darwin specific).

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=65666&r1=65665&r2=65666&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Fri Feb 27 18:54:00 2009
@@ -3394,6 +3394,8 @@
                                Init,
                                "\01L_OBJC_LABEL_CLASS_$",
                                &CGM.getModule());
+    GV->setAlignment(
+      CGM.getTargetData().getPrefTypeAlignment(ObjCTypes.Int8PtrTy));
     GV->setSection("__DATA, __objc_classlist, regular, no_dead_strip");
     UsedGlobals.push_back(GV);
   }





More information about the cfe-commits mailing list