[cfe-commits] r104001 - in /cfe/trunk: lib/AST/ASTContext.cpp test/CodeGenObjCXX/encode.mm
John McCall
rjmccall at apple.com
Mon May 17 16:56:34 PDT 2010
Author: rjmccall
Date: Mon May 17 18:56:34 2010
New Revision: 104001
URL: http://llvm.org/viewvc/llvm-project?rev=104001&view=rev
Log:
Teach the ObjC mangler to ignore member pointers just like gcc does.
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=104001&r1=104000&r2=104001&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Mon May 17 18:56:34 2010
@@ -3715,6 +3715,11 @@
return;
}
+ // gcc just blithely ignores member pointers.
+ // TODO: maybe there should be a mangling for these
+ if (T->getAs<MemberPointerType>())
+ 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=104001&r1=104000&r2=104001&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/encode.mm (original)
+++ cfe/trunk/test/CodeGenObjCXX/encode.mm Mon May 17 18:56:34 2010
@@ -2,7 +2,7 @@
// CHECK: v17 at 0:8{vector<float, float, float>=}16
// CHECK: {vector<float, float, float>=}
-
+// CHECK: v24 at 0:816
template <typename T1, typename T2, typename T3> struct vector {
vector(T1,T2,T3);
@@ -37,3 +37,15 @@
[sn setPosition:VF3];
}
@end
+
+
+class Int3 { int x, y, z; };
+
+// Enforce @encoding for member pointers.
+ at interface MemPtr {}
+- (void) foo: (int (Int3::*)) member;
+ at end
+ at implementation MemPtr
+- (void) foo: (int (Int3::*)) member {
+}
+ at end
More information about the cfe-commits
mailing list