diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-12 00:59:20 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-12 00:59:20 +0000 |
commit | 0ef3479cb79020c76ff4ad83e5d0fc39cb43b962 (patch) | |
tree | a24759f19442d5a95a417ce1252648d476f901d4 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 37a4e485292315cf9a2ffe156eca25b9a131b854 (diff) | |
download | bcm5719-llvm-0ef3479cb79020c76ff4ad83e5d0fc39cb43b962.tar.gz bcm5719-llvm-0ef3479cb79020c76ff4ad83e5d0fc39cb43b962.zip |
Change CodeGenModule::ConstructTypeAttributes to return the calling convention
to use, and allow the ABI implementation to override the calling convention.
llvm-svn: 81593
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index ae7a8b1dcb4..5dfc4bc1b9a 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -337,15 +337,12 @@ void CodeGenModule::SetFunctionDefinitionAttributes(const FunctionDecl *D, void CodeGenModule::SetLLVMFunctionAttributes(const Decl *D, const CGFunctionInfo &Info, llvm::Function *F) { + unsigned CallingConv; AttributeListType AttributeList; - ConstructAttributeList(Info, D, AttributeList); - + ConstructAttributeList(Info, D, AttributeList, CallingConv); F->setAttributes(llvm::AttrListPtr::get(AttributeList.begin(), - AttributeList.size())); - - llvm::CallingConv::ID CC = - static_cast<llvm::CallingConv::ID>(Info.getCallingConvention()); - F->setCallingConv(CC); + AttributeList.size())); + F->setCallingConv(static_cast<llvm::CallingConv::ID>(CallingConv)); } void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, @@ -1101,8 +1098,8 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, ArgList.clear(); if (NewCall->getType() != llvm::Type::getVoidTy(Old->getContext())) NewCall->takeName(CI); - NewCall->setCallingConv(CI->getCallingConv()); NewCall->setAttributes(CI->getAttributes()); + NewCall->setCallingConv(CI->getCallingConv()); // Finally, remove the old call, replacing any uses with the new one. if (!CI->use_empty()) |