]> granicus.if.org Git - clang/commitdiff
C++/ABI/x86_64: Member pointers should be classified as INTEGER.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 15 May 2010 00:00:37 +0000 (00:00 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 15 May 2010 00:00:37 +0000 (00:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103843 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp
test/CodeGenCXX/x86_64-arguments.cpp

index 176a7432b0c28371ad54b52c17f4f9f627acecff..4a0a298c3be3c97d47d3820f21a23561e628d7ab 100644 (file)
@@ -853,6 +853,11 @@ void X86_64ABIInfo::classify(QualType Ty,
     classify(ET->getDecl()->getIntegerType(), Context, OffsetBase, Lo, Hi);
   } else if (Ty->hasPointerRepresentation()) {
     Current = Integer;
+  } else if (Ty->isMemberPointerType()) {
+    if (Ty->isMemberFunctionPointerType())
+      Lo = Hi = Integer;
+    else
+      Current = Integer;
   } else if (const VectorType *VT = Ty->getAs<VectorType>()) {
     uint64_t Size = Context.getTypeSize(VT);
     if (Size == 32) {
index 7ebbedc9989ee9995eda40dff596aa6715e0c5ed..4bc83b85134eb4dcd97c8ca85550efc93a096947 100644 (file)
@@ -25,3 +25,11 @@ void f2(f2_s1 a0) { }
 struct s3_0 {};
 struct s3_1 { struct s3_0 a; long b; };
 void f3(struct s3_1 x) {}
+
+// CHECK: define i64 @_Z4f4_0M2s4i(i64)
+// CHECK: define [[i64_i64_ty]] @_Z4f4_1M2s4FivE([[i64_i64_ty]])
+struct s4 {};
+typedef int s4::* s4_mdp;
+typedef int (s4::*s4_mfp)();
+s4_mdp f4_0(s4_mdp a) { return a; }
+s4_mfp f4_1(s4_mfp a) { return a; }