diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-10-06 18:51:56 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-10-06 18:51:56 +0000 |
commit | fa4d6033a3a435956719107859848633f8df19b9 (patch) | |
tree | 2330987b4fe8e2ac31b54c168d1276c06d98816d /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | c4009383e8efdc4b08dc3c8ae98cf950336b9056 (diff) | |
download | llvm-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.cpp | 5 |
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); |