Coverage Report

Created: 2017-10-03 07:32

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