Coverage Report

Created: 2022-05-17 06:19

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Basic/Targets/DirectX.h
Line
Count
Source (jump to first uncovered line)
1
//===--- DirectX.h - Declare DirectX target feature support -----*- C++ -*-===//
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 file declares DXIL TargetInfo objects.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_DIRECTX_H
14
#define LLVM_CLANG_LIB_BASIC_TARGETS_DIRECTX_H
15
#include "clang/Basic/TargetInfo.h"
16
#include "clang/Basic/TargetOptions.h"
17
#include "llvm/ADT/Triple.h"
18
#include "llvm/Support/Compiler.h"
19
20
namespace clang {
21
namespace targets {
22
23
static const unsigned DirectXAddrSpaceMap[] = {
24
    0, // Default
25
    1, // opencl_global
26
    3, // opencl_local
27
    2, // opencl_constant
28
    0, // opencl_private
29
    4, // opencl_generic
30
    5, // opencl_global_device
31
    6, // opencl_global_host
32
    0, // cuda_device
33
    0, // cuda_constant
34
    0, // cuda_shared
35
    // SYCL address space values for this map are dummy
36
    0, // sycl_global
37
    0, // sycl_global_device
38
    0, // sycl_global_host
39
    0, // sycl_local
40
    0, // sycl_private
41
    0, // ptr32_sptr
42
    0, // ptr32_uptr
43
    0  // ptr64
44
};
45
46
class LLVM_LIBRARY_VISIBILITY DirectXTargetInfo : public TargetInfo {
47
public:
48
  DirectXTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
49
37
      : TargetInfo(Triple) {
50
37
    TLSSupported = false;
51
37
    VLASupported = false;
52
37
    LongWidth = LongAlign = 64;
53
37
    AddrSpaceMap = &DirectXAddrSpaceMap;
54
37
    UseAddrSpaceMapMangling = true;
55
37
    HasLegalHalfType = true;
56
37
    HasFloat16 = true;
57
37
    NoAsmVariants = true;
58
37
    resetDataLayout("e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:"
59
37
                    "32-f64:64-n8:16:32:64");
60
37
  }
clang::targets::DirectXTargetInfo::DirectXTargetInfo(llvm::Triple const&, clang::TargetOptions const&)
Line
Count
Source
49
37
      : TargetInfo(Triple) {
50
37
    TLSSupported = false;
51
37
    VLASupported = false;
52
37
    LongWidth = LongAlign = 64;
53
37
    AddrSpaceMap = &DirectXAddrSpaceMap;
54
37
    UseAddrSpaceMapMangling = true;
55
37
    HasLegalHalfType = true;
56
37
    HasFloat16 = true;
57
37
    NoAsmVariants = true;
58
37
    resetDataLayout("e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:"
59
37
                    "32-f64:64-n8:16:32:64");
60
37
  }
Unexecuted instantiation: clang::targets::DirectXTargetInfo::DirectXTargetInfo(llvm::Triple const&, clang::TargetOptions const&)
61
62
  void getTargetDefines(const LangOptions &Opts,
63
                        MacroBuilder &Builder) const override;
64
65
8
  bool hasFeature(StringRef Feature) const override {
66
8
    return Feature == "directx";
67
8
  }
68
69
37
  ArrayRef<Builtin::Info> getTargetBuiltins() const override { return None; }
70
71
0
  const char *getClobbers() const override { return ""; }
72
73
0
  ArrayRef<const char *> getGCCRegNames() const override { return None; }
74
75
  bool validateAsmConstraint(const char *&Name,
76
0
                             TargetInfo::ConstraintInfo &info) const override {
77
0
    return true;
78
0
  }
79
80
0
  ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
81
0
    return None;
82
0
  }
83
84
28
  BuiltinVaListKind getBuiltinVaListKind() const override {
85
28
    return TargetInfo::VoidPtrBuiltinVaList;
86
28
  }
87
};
88
89
} // namespace targets
90
} // namespace clang
91
92
#endif // LLVM_CLANG_LIB_BASIC_TARGETS_DIRECTX_H