Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- MSP430MCTargetDesc.cpp - MSP430 Target Descriptions ---------------===//
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 provides MSP430 specific target descriptions.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#include "MSP430MCTargetDesc.h"
15
#include "InstPrinter/MSP430InstPrinter.h"
16
#include "MSP430MCAsmInfo.h"
17
#include "llvm/MC/MCInstrInfo.h"
18
#include "llvm/MC/MCRegisterInfo.h"
19
#include "llvm/MC/MCSubtargetInfo.h"
20
#include "llvm/Support/TargetRegistry.h"
21
22
using namespace llvm;
23
24
#define GET_INSTRINFO_MC_DESC
25
#include "MSP430GenInstrInfo.inc"
26
27
#define GET_SUBTARGETINFO_MC_DESC
28
#include "MSP430GenSubtargetInfo.inc"
29
30
#define GET_REGINFO_MC_DESC
31
#include "MSP430GenRegisterInfo.inc"
32
33
64
static MCInstrInfo *createMSP430MCInstrInfo() {
34
64
  MCInstrInfo *X = new MCInstrInfo();
35
64
  InitMSP430MCInstrInfo(X);
36
64
  return X;
37
64
}
38
39
64
static MCRegisterInfo *createMSP430MCRegisterInfo(const Triple &TT) {
40
64
  MCRegisterInfo *X = new MCRegisterInfo();
41
64
  InitMSP430MCRegisterInfo(X, MSP430::PC);
42
64
  return X;
43
64
}
44
45
static MCSubtargetInfo *
46
64
createMSP430MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) {
47
64
  return createMSP430MCSubtargetInfoImpl(TT, CPU, FS);
48
64
}
49
50
static MCInstPrinter *createMSP430MCInstPrinter(const Triple &T,
51
                                                unsigned SyntaxVariant,
52
                                                const MCAsmInfo &MAI,
53
                                                const MCInstrInfo &MII,
54
62
                                                const MCRegisterInfo &MRI) {
55
62
  if (SyntaxVariant == 0)
56
62
    return new MSP430InstPrinter(MAI, MII, MRI);
57
0
  return nullptr;
58
0
}
59
60
70.1k
extern "C" void LLVMInitializeMSP430TargetMC() {
61
70.1k
  // Register the MC asm info.
62
70.1k
  RegisterMCAsmInfo<MSP430MCAsmInfo> X(getTheMSP430Target());
63
70.1k
64
70.1k
  // Register the MC instruction info.
65
70.1k
  TargetRegistry::RegisterMCInstrInfo(getTheMSP430Target(),
66
70.1k
                                      createMSP430MCInstrInfo);
67
70.1k
68
70.1k
  // Register the MC register info.
69
70.1k
  TargetRegistry::RegisterMCRegInfo(getTheMSP430Target(),
70
70.1k
                                    createMSP430MCRegisterInfo);
71
70.1k
72
70.1k
  // Register the MC subtarget info.
73
70.1k
  TargetRegistry::RegisterMCSubtargetInfo(getTheMSP430Target(),
74
70.1k
                                          createMSP430MCSubtargetInfo);
75
70.1k
76
70.1k
  // Register the MCInstPrinter.
77
70.1k
  TargetRegistry::RegisterMCInstPrinter(getTheMSP430Target(),
78
70.1k
                                        createMSP430MCInstPrinter);
79
70.1k
}