aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp15
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];