diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-09-10 00:41:16 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-10 00:41:16 +0000 |
commit | b768807c49a1c7085def099b848631856af766fa (patch) | |
tree | 21d82bbb3c1170b398415fb86346836e698c7bd0 /lib/CodeGen/CGCall.cpp | |
parent | 5323a4b0a1c248fa2ffdf886bb41a5d8fba71d2d (diff) |
Tweak CGCall functions again:
- Realized these functions will eventually need access to more data,
moved to CodeGenModule. Eventually they should probably live
together in some other helper class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 8f6bde412b..168eaf37bd 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -14,6 +14,7 @@ #include "CGCall.h" #include "CodeGenFunction.h" +#include "CodeGenModule.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclObjC.h" @@ -75,11 +76,11 @@ ArgTypeIterator CGCallInfo::argtypes_end() const { /***/ -bool CodeGenFunction::ReturnTypeUsesSret(QualType RetTy) { - return hasAggregateLLVMType(RetTy); +bool CodeGenModule::ReturnTypeUsesSret(QualType RetTy) { + return CodeGenFunction::hasAggregateLLVMType(RetTy); } -void CodeGenFunction::ConstructParamAttrList(const Decl *TargetDecl, +void CodeGenModule::ConstructParamAttrList(const Decl *TargetDecl, ArgTypeIterator begin, ArgTypeIterator end, ParamAttrListType &PAL) { @@ -94,7 +95,7 @@ void CodeGenFunction::ConstructParamAttrList(const Decl *TargetDecl, QualType ResTy = *begin; unsigned Index = 1; - if (CodeGenFunction::hasAggregateLLVMType(ResTy)) { + if (ReturnTypeUsesSret(ResTy)) { PAL.push_back(llvm::ParamAttrsWithIndex::get(Index, llvm::ParamAttr::StructRet)); ++Index; @@ -203,8 +204,9 @@ RValue CodeGenFunction::EmitCall(llvm::Value *Callee, // FIXME: Provide TargetDecl so nounwind, noreturn, etc, etc get set. CodeGen::ParamAttrListType ParamAttrList; - ConstructParamAttrList(0, CallInfo.argtypes_begin(), CallInfo.argtypes_end(), - ParamAttrList); + CGM.ConstructParamAttrList(0, + CallInfo.argtypes_begin(), CallInfo.argtypes_end(), + ParamAttrList); CI->setParamAttrs(llvm::PAListPtr::get(ParamAttrList.begin(), ParamAttrList.size())); |