summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-05-02 01:14:59 +0000
committerReid Kleckner <reid@kleckner.net>2014-05-02 01:14:59 +0000
commit7f5f0f3f6e634054b18ed15cdaddb1e897fa2d55 (patch)
tree622e0e4910a3c9fa51e4c964edfc192cd9ffc333 /clang/lib/CodeGen
parentf29bf9a169e2d07319178a383045903bbb3982db (diff)
downloadbcm5719-llvm-7f5f0f3f6e634054b18ed15cdaddb1e897fa2d55.tar.gz
bcm5719-llvm-7f5f0f3f6e634054b18ed15cdaddb1e897fa2d55.zip
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. llvm-svn: 207819
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index e45195dd261..9a8301617ff 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -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()) {
OpenPOWER on IntegriCloud