Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/CodeGen/CGCUDARuntime.cpp
Line
Count
Source
1
//===----- CGCUDARuntime.cpp - Interface to CUDA Runtimes -----------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This provides an abstract class for CUDA code generation.  Concrete
10
// subclasses of this implement code generation for specific CUDA
11
// runtime libraries.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#include "CGCUDARuntime.h"
16
#include "CGCall.h"
17
#include "CodeGenFunction.h"
18
#include "clang/AST/Decl.h"
19
#include "clang/AST/ExprCXX.h"
20
21
using namespace clang;
22
using namespace CodeGen;
23
24
103
CGCUDARuntime::~CGCUDARuntime() {}
25
26
RValue CGCUDARuntime::EmitCUDAKernelCallExpr(CodeGenFunction &CGF,
27
                                             const CUDAKernelCallExpr *E,
28
15
                                             ReturnValueSlot ReturnValue) {
29
15
  llvm::BasicBlock *ConfigOKBlock = CGF.createBasicBlock("kcall.configok");
30
15
  llvm::BasicBlock *ContBlock = CGF.createBasicBlock("kcall.end");
31
15
32
15
  CodeGenFunction::ConditionalEvaluation eval(CGF);
33
15
  CGF.EmitBranchOnBoolExpr(E->getConfig(), ContBlock, ConfigOKBlock,
34
15
                           /*TrueCount=*/0);
35
15
36
15
  eval.begin(CGF);
37
15
  CGF.EmitBlock(ConfigOKBlock);
38
15
  CGF.EmitSimpleCallExpr(E, ReturnValue);
39
15
  CGF.EmitBranch(ContBlock);
40
15
41
15
  CGF.EmitBlock(ContBlock);
42
15
  eval.end(CGF);
43
15
44
15
  return RValue::get(nullptr);
45
15
}