aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-03-07 20:04:22 +0000
committerNate Begeman <natebegeman@mac.com>2008-03-07 20:04:22 +0000
commit440b456709526c4277e71d2e0ff49e5d88dc7b17 (patch)
tree1445c340c6afe916db9d2fdeafd3f37ae79447e3 /CodeGen/CodeGenFunction.cpp
parent4d839b4949efe9e2b16eeab679c25b28e31ea742 (diff)
Add fastcall/stdcall attribute support
Generate CallingConv::Fast when fastcall attribute is present git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenFunction.cpp')
-rw-r--r--CodeGen/CodeGenFunction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/CodeGen/CodeGenFunction.cpp b/CodeGen/CodeGenFunction.cpp
index f48d093b25..7d70e6c831 100644
--- a/CodeGen/CodeGenFunction.cpp
+++ b/CodeGen/CodeGenFunction.cpp
@@ -15,6 +15,7 @@
#include "CodeGenModule.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/AST/AST.h"
+#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
@@ -76,6 +77,9 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD) {
else if (FD->getStorageClass() == FunctionDecl::Static)
CurFn->setLinkage(llvm::Function::InternalLinkage);
+ if (FD->getAttr<FastCallAttr>())
+ CurFn->setCallingConv(llvm::CallingConv::Fast);
+
if (const VisibilityAttr *attr = FD->getAttr<VisibilityAttr>())
CurFn->setVisibility(attr->getVisibility());
// FIXME: else handle -fvisibility