aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-10-06 18:51:56 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-10-06 18:51:56 +0000
commitfa4d6033a3a435956719107859848633f8df19b9 (patch)
tree2330987b4fe8e2ac31b54c168d1276c06d98816d /clang/lib/CodeGen/CodeGenFunction.cpp
parentc4009383e8efdc4b08dc3c8ae98cf950336b9056 (diff)
downloadllvm-fa4d6033a3a435956719107859848633f8df19b9.zip
llvm-fa4d6033a3a435956719107859848633f8df19b9.tar.gz
llvm-fa4d6033a3a435956719107859848633f8df19b9.tar.bz2
CUDA: IR generation support for device stubs
llvm-svn: 141304
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 4c6624f..12def67 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -13,6 +13,7 @@
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
+#include "CGCUDARuntime.h"
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGException.h"
@@ -404,6 +405,10 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
EmitDestructorBody(Args);
else if (isa<CXXConstructorDecl>(FD))
EmitConstructorBody(Args);
+ else if (getContext().getLangOptions().CUDA &&
+ !CGM.getCodeGenOpts().CUDAIsDevice &&
+ FD->hasAttr<CUDAGlobalAttr>())
+ CGM.getCUDARuntime().EmitDeviceStubBody(*this, Args);
else
EmitFunctionBody(Args);