From 0eb1be38d149f22aab802958086a295628a3d76f Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Tue, 16 Jul 2013 10:52:03 -0700 Subject: Mop up errors - now it compiles. --- lib/CodeGen/ItaniumCXXABI.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index 9ab3f8c3ee..8a7f551e68 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/lib/CodeGen/ItaniumCXXABI.cpp @@ -57,6 +57,20 @@ public: UseARMMethodPtrABI(UseARMMethodPtrABI), UseARMGuardVarABI(UseARMGuardVarABI) { } + bool isReturnTypeIndirect(const CXXRecordDecl *RD) const { + // Structures with either a non-trivial destructor or a non-trivial + // copy constructor are always indirect. + return !RD->hasTrivialDestructor() || RD->hasNonTrivialCopyConstructor(); + } + + RecordArgABI getRecordArgABI(const CXXRecordDecl *RD) const { + // Structures with either a non-trivial destructor or a non-trivial + // copy constructor are always indirect. + if (!RD->hasTrivialDestructor() || RD->hasNonTrivialCopyConstructor()) + return RAA_Indirect; + return RAA_Default; + } + bool isZeroInitializable(const MemberPointerType *MPT); llvm::Type *ConvertMemberPointerType(const MemberPointerType *MPT); @@ -572,8 +586,8 @@ llvm::Constant *ItaniumCXXABI::BuildMemberPointer(const CXXMethodDecl *MD, } llvm::Constant *addr = CGM.GetAddrOfFunction(MD, Ty); - MemPtr[0] = llvm::ConstantExpr::getPtrToInt(addr, ptrdiff_t); - MemPtr[1] = llvm::ConstantInt::get(ptrdiff_t, + MemPtr[0] = llvm::ConstantExpr::getPtrToInt(addr, CGM.PtrDiffTy); + MemPtr[1] = llvm::ConstantInt::get(CGM.PtrDiffTy, (UseARMMethodPtrABI ? 2 : 1) * ThisAdjustment.getQuantity()); } -- cgit v1.2.3-18-g5258