diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-09-10 04:01:49 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-10 04:01:49 +0000 |
commit | 45c25ba11cbf8c9a461def5b03f6ee9481e06769 (patch) | |
tree | 2be394b3b5a29a887130e782ffc0fcac8a1f48cd /lib/CodeGen/CodeGenModule.cpp | |
parent | 2c8e0f32b9c33686be23c70add0b97490903de9f (diff) |
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
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
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<FastCallAttr>()) + if (D->getAttr<FastCallAttr>()) 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]; |