if (!Ty->getPointeeType()->isFunctionType())
return DBuilder.createMemberPointerType(
getOrCreateType(Ty->getPointeeType(), U), ClassType,
- CGM.PointerWidthInBits);
+ CGM.getContext().getTypeSize(Ty));
const FunctionProtoType *FPT =
Ty->getPointeeType()->getAs<FunctionProtoType>();
getOrCreateInstanceMethodType(CGM.getContext().getPointerType(QualType(
Ty->getClass(), FPT->getTypeQuals())),
FPT, U),
- ClassType, CGM.PointerWidthInBits);
+ ClassType, CGM.getContext().getTypeSize(Ty));
}
llvm::DIType CGDebugInfo::CreateType(const AtomicType *Ty, llvm::DIFile U) {
--- /dev/null
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -g -emit-llvm -o - | FileCheck %s
+
+struct T {
+ int method();
+};
+
+void foo(int (T::*method)()) {}
+
+// A pointer to a member function is a pair of function- and this-pointer.
+// CHECK: [ DW_TAG_ptr_to_member_type ] {{.*}} size 128