summaryrefslogtreecommitdiffstats
path: root/clang/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
commit0a6192cfb8d8c474bea48550113670b0ef6cd8ea (patch)
tree3fd85ce42376045ed262ee79efb18916fd5a8790 /clang/CodeGen/CodeGenFunction.cpp
parent47d774b2c85002a705ff4e010e75d8df893c1e93 (diff)
downloadbcm5719-llvm-0a6192cfb8d8c474bea48550113670b0ef6cd8ea.tar.gz
bcm5719-llvm-0a6192cfb8d8c474bea48550113670b0ef6cd8ea.zip
Add fastcall/stdcall attribute support
Generate CallingConv::Fast when fastcall attribute is present llvm-svn: 48017
Diffstat (limited to 'clang/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/CodeGen/CodeGenFunction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/CodeGen/CodeGenFunction.cpp b/clang/CodeGen/CodeGenFunction.cpp
index f48d093b25e..7d70e6c8310 100644
--- a/clang/CodeGen/CodeGenFunction.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud