Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/MSP430/MSP430Subtarget.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- MSP430Subtarget.cpp - MSP430 Subtarget Information ----------------===//
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 implements the MSP430 specific subclass of TargetSubtargetInfo.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "MSP430Subtarget.h"
14
#include "MSP430.h"
15
#include "llvm/Support/TargetRegistry.h"
16
17
using namespace llvm;
18
19
#define DEBUG_TYPE "msp430-subtarget"
20
21
static cl::opt<MSP430Subtarget::HWMultEnum>
22
HWMultModeOption("mhwmult", cl::Hidden,
23
           cl::desc("Hardware multiplier use mode for MSP430"),
24
           cl::init(MSP430Subtarget::NoHWMult),
25
           cl::values(
26
             clEnumValN(MSP430Subtarget::NoHWMult, "none",
27
                "Do not use hardware multiplier"),
28
             clEnumValN(MSP430Subtarget::HWMult16, "16bit",
29
                "Use 16-bit hardware multiplier"),
30
             clEnumValN(MSP430Subtarget::HWMult32, "32bit",
31
                "Use 32-bit hardware multiplier"),
32
             clEnumValN(MSP430Subtarget::HWMultF5, "f5series",
33
                "Use F5 series hardware multiplier")));
34
35
#define GET_SUBTARGETINFO_TARGET_DESC
36
#define GET_SUBTARGETINFO_CTOR
37
#include "MSP430GenSubtargetInfo.inc"
38
39
0
void MSP430Subtarget::anchor() { }
40
41
MSP430Subtarget &
42
77
MSP430Subtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) {
43
77
  ExtendedInsts = false;
44
77
  HWMultMode = NoHWMult;
45
77
46
77
  std::string CPUName = CPU;
47
77
  if (CPUName.empty())
48
77
    CPUName = "msp430";
49
77
50
77
  ParseSubtargetFeatures(CPUName, FS);
51
77
52
77
  if (HWMultModeOption != NoHWMult)
53
3
    HWMultMode = HWMultModeOption;
54
77
55
77
  return *this;
56
77
}
57
58
MSP430Subtarget::MSP430Subtarget(const Triple &TT, const std::string &CPU,
59
                                 const std::string &FS, const TargetMachine &TM)
60
    : MSP430GenSubtargetInfo(TT, CPU, FS), FrameLowering(),
61
77
      InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this) {}