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 | 7a95ca31973467becb90c944b4d4fd0ea4d40620 (patch) | |
tree | e3529e42db6e1ba6fdba4f965efd78dcdded16ec /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | a72d4aece6a9662368b7505d5094eeb54249113b (diff) | |
download | bcm5719-llvm-7a95ca31973467becb90c944b4d4fd0ea4d40620.tar.gz bcm5719-llvm-7a95ca31973467becb90c944b4d4fd0ea4d40620.zip |
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.
llvm-svn: 56047
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e5acc505f5b..c0863578e88 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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]; |