Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Basic/Targets/MSP430.h
Line
Count
Source (jump to first uncovered line)
1
//===--- MSP430.h - Declare MSP430 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 MSP430 TargetInfo objects.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_MSP430_H
14
#define LLVM_CLANG_LIB_BASIC_TARGETS_MSP430_H
15
16
#include "clang/Basic/TargetInfo.h"
17
#include "clang/Basic/TargetOptions.h"
18
#include "llvm/ADT/Triple.h"
19
#include "llvm/Support/Compiler.h"
20
21
namespace clang {
22
namespace targets {
23
24
class LLVM_LIBRARY_VISIBILITY MSP430TargetInfo : public TargetInfo {
25
  static const char *const GCCRegNames[];
26
27
public:
28
  MSP430TargetInfo(const llvm::Triple &Triple, const TargetOptions &)
29
13
      : TargetInfo(Triple) {
30
13
    TLSSupported = false;
31
13
    IntWidth = 16;
32
13
    IntAlign = 16;
33
13
    LongWidth = 32;
34
13
    LongLongWidth = 64;
35
13
    LongAlign = LongLongAlign = 16;
36
13
    FloatWidth = 32;
37
13
    FloatAlign = 16;
38
13
    DoubleWidth = LongDoubleWidth = 64;
39
13
    DoubleAlign = LongDoubleAlign = 16;
40
13
    PointerWidth = 16;
41
13
    PointerAlign = 16;
42
13
    SuitableAlign = 16;
43
13
    SizeType = UnsignedInt;
44
13
    IntMaxType = SignedLongLong;
45
13
    IntPtrType = SignedInt;
46
13
    PtrDiffType = SignedInt;
47
13
    SigAtomicType = SignedLong;
48
13
    resetDataLayout("e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16");
49
13
  }
clang::targets::MSP430TargetInfo::MSP430TargetInfo(llvm::Triple const&, clang::TargetOptions const&)
Line
Count
Source
29
13
      : TargetInfo(Triple) {
30
13
    TLSSupported = false;
31
13
    IntWidth = 16;
32
13
    IntAlign = 16;
33
13
    LongWidth = 32;
34
13
    LongLongWidth = 64;
35
13
    LongAlign = LongLongAlign = 16;
36
13
    FloatWidth = 32;
37
13
    FloatAlign = 16;
38
13
    DoubleWidth = LongDoubleWidth = 64;
39
13
    DoubleAlign = LongDoubleAlign = 16;
40
13
    PointerWidth = 16;
41
13
    PointerAlign = 16;
42
13
    SuitableAlign = 16;
43
13
    SizeType = UnsignedInt;
44
13
    IntMaxType = SignedLongLong;
45
13
    IntPtrType = SignedInt;
46
13
    PtrDiffType = SignedInt;
47
13
    SigAtomicType = SignedLong;
48
13
    resetDataLayout("e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16");
49
13
  }
Unexecuted instantiation: clang::targets::MSP430TargetInfo::MSP430TargetInfo(llvm::Triple const&, clang::TargetOptions const&)
50
  void getTargetDefines(const LangOptions &Opts,
51
                        MacroBuilder &Builder) const override;
52
53
13
  ArrayRef<Builtin::Info> getTargetBuiltins() const override {
54
13
    // FIXME: Implement.
55
13
    return None;
56
13
  }
57
58
26
  bool allowsLargerPreferedTypeAlignment() const override { return false; }
59
60
0
  bool hasFeature(StringRef Feature) const override {
61
0
    return Feature == "msp430";
62
0
  }
63
64
  ArrayRef<const char *> getGCCRegNames() const override;
65
66
0
  ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {
67
0
    // No aliases.
68
0
    return None;
69
0
  }
70
71
  bool validateAsmConstraint(const char *&Name,
72
0
                             TargetInfo::ConstraintInfo &info) const override {
73
0
    // FIXME: implement
74
0
    switch (*Name) {
75
0
    case 'K': // the constant 1
76
0
    case 'L': // constant -1^20 .. 1^19
77
0
    case 'M': // constant 1-4:
78
0
      return true;
79
0
    }
80
0
    // No target constraints for now.
81
0
    return false;
82
0
  }
83
84
2
  const char *getClobbers() const override {
85
2
    // FIXME: Is this really right?
86
2
    return "";
87
2
  }
88
89
10
  BuiltinVaListKind getBuiltinVaListKind() const override {
90
10
    // FIXME: implement
91
10
    return TargetInfo::CharPtrBuiltinVaList;
92
10
  }
93
};
94
95
} // namespace targets
96
} // namespace clang
97
#endif // LLVM_CLANG_LIB_BASIC_TARGETS_MSP430_H