/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===-- MSP430MCTargetDesc.cpp - MSP430 Target Descriptions ---------------===// |
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 provides MSP430 specific target descriptions. |
10 | | // |
11 | | //===----------------------------------------------------------------------===// |
12 | | |
13 | | #include "MSP430MCTargetDesc.h" |
14 | | #include "MSP430InstPrinter.h" |
15 | | #include "MSP430MCAsmInfo.h" |
16 | | #include "TargetInfo/MSP430TargetInfo.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 | 104 | static MCInstrInfo *createMSP430MCInstrInfo() { |
34 | 104 | MCInstrInfo *X = new MCInstrInfo(); |
35 | 104 | InitMSP430MCInstrInfo(X); |
36 | 104 | return X; |
37 | 104 | } |
38 | | |
39 | 95 | static MCRegisterInfo *createMSP430MCRegisterInfo(const Triple &TT) { |
40 | 95 | MCRegisterInfo *X = new MCRegisterInfo(); |
41 | 95 | InitMSP430MCRegisterInfo(X, MSP430::PC); |
42 | 95 | return X; |
43 | 95 | } |
44 | | |
45 | | static MCSubtargetInfo * |
46 | 93 | createMSP430MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) { |
47 | 93 | return createMSP430MCSubtargetInfoImpl(TT, CPU, FS); |
48 | 93 | } |
49 | | |
50 | | static MCInstPrinter *createMSP430MCInstPrinter(const Triple &T, |
51 | | unsigned SyntaxVariant, |
52 | | const MCAsmInfo &MAI, |
53 | | const MCInstrInfo &MII, |
54 | 83 | const MCRegisterInfo &MRI) { |
55 | 83 | if (SyntaxVariant == 0) |
56 | 83 | return new MSP430InstPrinter(MAI, MII, MRI); |
57 | 0 | return nullptr; |
58 | 0 | } |
59 | | |
60 | 96.4k | extern "C" void LLVMInitializeMSP430TargetMC() { |
61 | 96.4k | Target &T = getTheMSP430Target(); |
62 | 96.4k | |
63 | 96.4k | RegisterMCAsmInfo<MSP430MCAsmInfo> X(T); |
64 | 96.4k | TargetRegistry::RegisterMCInstrInfo(T, createMSP430MCInstrInfo); |
65 | 96.4k | TargetRegistry::RegisterMCRegInfo(T, createMSP430MCRegisterInfo); |
66 | 96.4k | TargetRegistry::RegisterMCSubtargetInfo(T, createMSP430MCSubtargetInfo); |
67 | 96.4k | TargetRegistry::RegisterMCInstPrinter(T, createMSP430MCInstPrinter); |
68 | 96.4k | TargetRegistry::RegisterMCCodeEmitter(T, createMSP430MCCodeEmitter); |
69 | 96.4k | TargetRegistry::RegisterMCAsmBackend(T, createMSP430MCAsmBackend); |
70 | 96.4k | TargetRegistry::RegisterObjectTargetStreamer( |
71 | 96.4k | T, createMSP430ObjectTargetStreamer); |
72 | 96.4k | } |