Coverage Report

Created: 2023-11-11 10:31

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Basic/Targets/XCore.h
Line
Count
Source (jump to first uncovered line)
1
//===--- XCore.h - Declare XCore 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 XCore TargetInfo objects.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_XCORE_H
14
#define LLVM_CLANG_LIB_BASIC_TARGETS_XCORE_H
15
16
#include "clang/Basic/TargetInfo.h"
17
#include "clang/Basic/TargetOptions.h"
18
#include "llvm/Support/Compiler.h"
19
#include "llvm/TargetParser/Triple.h"
20
21
namespace clang {
22
namespace targets {
23
24
class LLVM_LIBRARY_VISIBILITY XCoreTargetInfo : public TargetInfo {
25
26
public:
27
  XCoreTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
28
19
      : TargetInfo(Triple) {
29
19
    NoAsmVariants = true;
30
19
    LongLongAlign = 32;
31
19
    SuitableAlign = 32;
32
19
    DoubleAlign = LongDoubleAlign = 32;
33
19
    SizeType = UnsignedInt;
34
19
    PtrDiffType = SignedInt;
35
19
    IntPtrType = SignedInt;
36
19
    WCharType = UnsignedChar;
37
19
    WIntType = UnsignedInt;
38
19
    UseZeroLengthBitfieldAlignment = true;
39
19
    resetDataLayout("e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32"
40
19
                    "-f64:32-a:0:32-n32");
41
19
  }
42
43
  void getTargetDefines(const LangOptions &Opts,
44
                        MacroBuilder &Builder) const override;
45
46
  ArrayRef<Builtin::Info> getTargetBuiltins() const override;
47
48
15
  BuiltinVaListKind getBuiltinVaListKind() const override {
49
15
    return TargetInfo::VoidPtrBuiltinVaList;
50
15
  }
51
52
0
  std::string_view getClobbers() const override { return ""; }
53
54
0
  ArrayRef<const char *> getGCCRegNames() const override {
55
0
    static const char *const GCCRegNames[] = {
56
0
        "r0", "r1", "r2",  "r3",  "r4", "r5", "r6", "r7",
57
0
        "r8", "r9", "r10", "r11", "cp", "dp", "sp", "lr"
58
0
    };
59
0
    return llvm::ArrayRef(GCCRegNames);
60
0
  }
61
62
0
  ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
63
0
    return std::nullopt;
64
0
  }
65
66
  bool validateAsmConstraint(const char *&Name,
67
0
                             TargetInfo::ConstraintInfo &Info) const override {
68
0
    return false;
69
0
  }
70
71
0
  int getEHDataRegisterNumber(unsigned RegNo) const override {
72
    // R0=ExceptionPointerRegister R1=ExceptionSelectorRegister
73
0
    return (RegNo < 2) ? RegNo : -1;
74
0
  }
75
76
12
  bool allowsLargerPreferedTypeAlignment() const override { return false; }
77
78
10
  bool hasBitIntType() const override { return true; }
79
};
80
} // namespace targets
81
} // namespace clang
82
#endif // LLVM_CLANG_LIB_BASIC_TARGETS_XCORE_H