From 45c25ba11cbf8c9a461def5b03f6ee9481e06769 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 10 Sep 2008 04:01:49 +0000 Subject: Move FunctionType conversion into CGCall.cpp: - Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo. - Updated Obj-C runtimes to use this instead of rolling the llvm::FunctionType by hand. - Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}. Add ABIArgInfo class to encapsulate ABI decision of how to lower types to LLVM. - Will move to target sometime soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56047 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index e5acc505f5..c0863578e8 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -212,18 +212,18 @@ static void SetGlobalValueAttributes(const Decl *D, } } -void CodeGenModule::SetFunctionParamAttrs(const CGFunctionInfo &Info, +void CodeGenModule::SetFunctionParamAttrs(const Decl *D, + const CGFunctionInfo &Info, llvm::Function *F) { ParamAttrListType ParamAttrList; - ConstructParamAttrList(Info.getDecl(), - Info.argtypes_begin(), Info.argtypes_end(), + ConstructParamAttrList(D, Info.argtypes_begin(), Info.argtypes_end(), ParamAttrList); F->setParamAttrs(llvm::PAListPtr::get(ParamAttrList.begin(), ParamAttrList.size())); // Set the appropriate calling convention for the Function. - if (Info.getDecl()->getAttr()) + if (D->getAttr()) F->setCallingConv(llvm::CallingConv::Fast); } @@ -245,19 +245,20 @@ void CodeGenModule::SetFunctionAttributesForDefinition(const Decl *D, void CodeGenModule::SetMethodAttributes(const ObjCMethodDecl *MD, llvm::Function *F) { - SetFunctionParamAttrs(CGFunctionInfo(MD, Context), F); + SetFunctionParamAttrs(MD, CGFunctionInfo(MD, Context), F); SetFunctionAttributesForDefinition(MD, F); } void CodeGenModule::SetFunctionAttributes(const FunctionDecl *FD, llvm::Function *F) { - SetFunctionParamAttrs(CGFunctionInfo(FD), F); - + SetFunctionParamAttrs(FD, CGFunctionInfo(FD), F); + SetGlobalValueAttributes(FD, FD->getStorageClass() == FunctionDecl::Static, FD->isInline(), F, false); } + void CodeGenModule::EmitAliases() { for (unsigned i = 0, e = Aliases.size(); i != e; ++i) { const FunctionDecl *D = Aliases[i]; -- cgit v1.2.3-18-g5258