From a4ae2294b6ebfb2554aacb6a6a0682fb5ed1f276 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 6 Oct 2011 18:51:56 +0000 Subject: CUDA: IR generation support for device stubs git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141304 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 4c6624f761..12def6728f 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/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(FD)) EmitConstructorBody(Args); + else if (getContext().getLangOptions().CUDA && + !CGM.getCodeGenOpts().CUDAIsDevice && + FD->hasAttr()) + CGM.getCUDARuntime().EmitDeviceStubBody(*this, Args); else EmitFunctionBody(Args); -- cgit v1.2.3-18-g5258