aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-03-09 03:09:36 +0000
committerNate Begeman <natebegeman@mac.com>2008-03-09 03:09:36 +0000
commitec9426ca6039279bcc99bc2c625bb2abe4f0353d (patch)
tree48b4b1ac61384b506783a826a3d43a7f3b4abf6f /CodeGen/CodeGenModule.cpp
parentfde2bf9befede63e3f01f84519784c17b4c81480 (diff)
Propagate calling convention information to function declarations and CallInst
instructions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenModule.cpp')
-rw-r--r--CodeGen/CodeGenModule.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp
index d2b6047525..0b39ca4437 100644
--- a/CodeGen/CodeGenModule.cpp
+++ b/CodeGen/CodeGenModule.cpp
@@ -18,6 +18,7 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/TargetInfo.h"
+#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
@@ -87,8 +88,13 @@ llvm::Constant *CodeGenModule::GetAddrOfFunctionDecl(const FunctionDecl *D,
// If it doesn't already exist, just create and return an entry.
if (F == 0) {
// FIXME: param attributes for sext/zext etc.
- return Entry = new llvm::Function(FTy, llvm::Function::ExternalLinkage,
- D->getName(), &getModule());
+ F = new llvm::Function(FTy, llvm::Function::ExternalLinkage, D->getName(),
+ &getModule());
+
+ // Set the appropriate calling convention for the Function.
+ if (D->getAttr<FastCallAttr>())
+ F->setCallingConv(llvm::CallingConv::Fast);
+ return Entry = F;
}
// If the pointer type matches, just return it.