[cfe-commits] r115980 - in /cfe/trunk: lib/AST/ASTContext.cpp test/CodeGenObjCXX/encode.mm

Fariborz Jahanian fjahanian at apple.com
Thu Oct 7 14:25:25 PDT 2010


Author: fjahanian
Date: Thu Oct  7 16:25:25 2010
New Revision: 115980

URL: http://llvm.org/viewvc/llvm-project?rev=115980&view=rev
Log:
Fix a crash encoding ivars of vector types and 
to match gcc's encoding. Fixes //rdar: // 8519948.


Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/CodeGenObjCXX/encode.mm

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=115980&r1=115979&r2=115980&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Oct  7 16:25:25 2010
@@ -3894,7 +3894,7 @@
     S += RDecl->isUnion() ? ')' : '}';
     return;
   }
-
+  
   if (T->isEnumeralType()) {
     if (FD && FD->isBitField())
       EncodeBitField(this, S, T, FD);
@@ -3997,7 +3997,14 @@
   // TODO: maybe there should be a mangling for these
   if (T->getAs<MemberPointerType>())
     return;
-
+  
+  if (T->isVectorType()) {
+    // This matches gcc's encoding, even though technically it is
+    // insufficient.
+    // FIXME. We should do a better job than gcc.
+    return;
+  }
+  
   assert(0 && "@encode for type not implemented!");
 }
 

Modified: cfe/trunk/test/CodeGenObjCXX/encode.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/encode.mm?rev=115980&r1=115979&r2=115980&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/encode.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/encode.mm Thu Oct  7 16:25:25 2010
@@ -50,3 +50,15 @@
 - (void) foo: (int (Int3::*)) member {
 }
 @end
+
+// rdar: // 8519948
+typedef float HGVec4f __attribute__ ((vector_size(16)));
+
+ at interface RedBalloonHGXFormWrapper {
+  HGVec4f m_Transform[4];
+}
+ at end
+
+ at implementation RedBalloonHGXFormWrapper
+ at end
+





More information about the cfe-commits mailing list