mirror of https://github.com/microsoft/clang.git
Win64: Use ConvertType instead of checking the MS inheritance
dependent-type-member-pointer.cpp is failing on a win64 bot because -fms-extensions is not enabled. Use ConvertType rather than relying on the inheritance attributes. It's less code, but probably slower. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207819 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e0526bf22e
commit
2336f58e88
|
@ -2737,18 +2737,11 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, bool IsReturnType) const {
|
|||
}
|
||||
|
||||
if (const auto *MPT = Ty->getAs<MemberPointerType>()) {
|
||||
// If the member pointer is not an aggregate, pass it directly.
|
||||
if (getTarget().getCXXABI().isMicrosoft()) {
|
||||
// For Microsoft, check with the inheritance model.
|
||||
const CXXRecordDecl *RD = MPT->getClass()->getAsCXXRecordDecl();
|
||||
if (MSInheritanceAttr::hasOnlyOneField(MPT->isMemberFunctionPointer(),
|
||||
RD->getMSInheritanceModel()))
|
||||
return ABIArgInfo::getDirect();
|
||||
} else {
|
||||
// For Itanium, data pointers are simple and function pointers are big.
|
||||
if (MPT->isMemberDataPointer())
|
||||
return ABIArgInfo::getDirect();
|
||||
}
|
||||
// If the member pointer is represented by an LLVM int or ptr, pass it
|
||||
// directly.
|
||||
llvm::Type *LLTy = CGT.ConvertType(Ty);
|
||||
if (LLTy->isPointerTy() || LLTy->isIntegerTy())
|
||||
return ABIArgInfo::getDirect();
|
||||
}
|
||||
|
||||
if (RT || Ty->isMemberPointerType()) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// RUN: %clang_cc1 -emit-llvm-only -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -emit-llvm-only -verify %s
|
||||
// expected-no-diagnostics
|
||||
// PR7736
|
||||
|
||||
|
|
Loading…
Reference in New Issue