diff options
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 3c3765a1ae..1d9a9a6a8c 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -36,7 +36,6 @@ static unsigned ClangCallConvToLLVMCallConv(CallingConv CC) { case CC_X86StdCall: return llvm::CallingConv::X86_StdCall; case CC_X86FastCall: return llvm::CallingConv::X86_FastCall; case CC_X86ThisCall: return llvm::CallingConv::X86_ThisCall; - case CC_Win64ThisCall: return llvm::CallingConv::Win64_ThisCall; // TODO: add support for CC_X86Pascal to llvm } } @@ -76,23 +75,19 @@ CodeGenTypes::getFunctionInfo(CanQual<FunctionNoProtoType> FTNP, static const CGFunctionInfo &getFunctionInfo(CodeGenTypes &CGT, llvm::SmallVectorImpl<CanQualType> &ArgTys, CanQual<FunctionProtoType> FTP, - CallingConv CC, bool IsRecursive = false) { // FIXME: Kill copy. for (unsigned i = 0, e = FTP->getNumArgs(); i != e; ++i) ArgTys.push_back(FTP->getArgType(i)); CanQualType ResTy = FTP->getResultType().getUnqualifiedType(); - - return CGT.getFunctionInfo(ResTy, ArgTys, - FTP->getExtInfo().withCallingConv(CC), - IsRecursive); + return CGT.getFunctionInfo(ResTy, ArgTys, FTP->getExtInfo(), IsRecursive); } const CGFunctionInfo & CodeGenTypes::getFunctionInfo(CanQual<FunctionProtoType> FTP, bool IsRecursive) { llvm::SmallVector<CanQualType, 16> ArgTys; - return ::getFunctionInfo(*this, ArgTys, FTP, CC_Default, IsRecursive); + return ::getFunctionInfo(*this, ArgTys, FTP, IsRecursive); } static CallingConv getCallingConventionForDecl(const Decl *D) { @@ -119,10 +114,8 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXRecordDecl *RD, // Add the 'this' pointer. ArgTys.push_back(GetThisType(Context, RD)); - CallingConv CC = Context.Target.isWin64() ? CC_Win64ThisCall : CC_Default; - return ::getFunctionInfo(*this, ArgTys, - FTP->getCanonicalTypeUnqualified().getAs<FunctionProtoType>(), CC); + FTP->getCanonicalTypeUnqualified().getAs<FunctionProtoType>()); } const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXMethodDecl *MD) { @@ -135,9 +128,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXMethodDecl *MD) { if (MD->isInstance()) ArgTys.push_back(GetThisType(Context, MD->getParent())); - CallingConv CC = Context.Target.isWin64() ? CC_Win64ThisCall : CC_Default; - - return ::getFunctionInfo(*this, ArgTys, GetFormalType(MD), CC); + return ::getFunctionInfo(*this, ArgTys, GetFormalType(MD)); } const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXConstructorDecl *D, @@ -154,9 +145,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXConstructorDecl *D, for (unsigned i = 0, e = FTP->getNumArgs(); i != e; ++i) ArgTys.push_back(FTP->getArgType(i)); - CallingConv CC = Context.Target.isWin64() ? CC_Win64ThisCall : CC_Default; - - return getFunctionInfo(ResTy, ArgTys, FTP->getExtInfo().withCallingConv(CC)); + return getFunctionInfo(ResTy, ArgTys, FTP->getExtInfo()); } const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXDestructorDecl *D, @@ -170,9 +159,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const CXXDestructorDecl *D, CanQual<FunctionProtoType> FTP = GetFormalType(D); assert(FTP->getNumArgs() == 0 && "dtor with formal parameters"); - CallingConv CC = Context.Target.isWin64() ? CC_Win64ThisCall : CC_Default; - - return getFunctionInfo(ResTy, ArgTys, FTP->getExtInfo().withCallingConv(CC)); + return getFunctionInfo(ResTy, ArgTys, FTP->getExtInfo()); } const CGFunctionInfo &CodeGenTypes::getFunctionInfo(const FunctionDecl *FD) { @@ -263,8 +250,8 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(CanQualType ResTy, return *FI; // Construct the function info. - FI = new CGFunctionInfo(CC, Info.getNoReturn(), Info.getRegParm(), - ResTy, ArgTys.data(), ArgTys.size()); + FI = new CGFunctionInfo(CC, Info.getNoReturn(), Info.getRegParm(), ResTy, + ArgTys.data(), ArgTys.size()); FunctionInfos.InsertNode(FI, InsertPos); // Compute ABI information. |