blob: 6c5156f6d700db88d94ba252e4aae9a33f50b51c [file] [log] [blame]
Anton Korobeynikovf2c3e172009-05-03 12:57:15 +00001//===- MSP430Subtarget.cpp - MSP430 Subtarget Information ---------*- 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//
Evan Cheng5b1b44892011-07-01 21:01:15 +000010// This file implements the MSP430 specific subclass of TargetSubtargetInfo.
Anton Korobeynikovf2c3e172009-05-03 12:57:15 +000011//
12//===----------------------------------------------------------------------===//
13
14#include "MSP430Subtarget.h"
15#include "MSP430.h"
Evan Chengffc0e732011-07-09 05:47:46 +000016#include "llvm/Target/TargetRegistry.h"
Evan Cheng94214702011-07-01 20:45:01 +000017
Evan Chengebdeeab2011-07-08 01:53:10 +000018#define GET_SUBTARGETINFO_ENUM
Evan Cheng94214702011-07-01 20:45:01 +000019#define GET_SUBTARGETINFO_MC_DESC
20#define GET_SUBTARGETINFO_TARGET_DESC
Evan Chengebdeeab2011-07-08 01:53:10 +000021#define GET_SUBTARGETINFO_CTOR
Evan Cheng385e9302011-07-01 22:36:09 +000022#include "MSP430GenSubtargetInfo.inc"
Anton Korobeynikovf2c3e172009-05-03 12:57:15 +000023
24using namespace llvm;
25
Evan Cheng276365d2011-06-30 01:53:36 +000026MSP430Subtarget::MSP430Subtarget(const std::string &TT,
Evan Cheng0ddff1b2011-07-07 07:07:08 +000027 const std::string &CPU,
28 const std::string &FS) :
29 MSP430GenSubtargetInfo(TT, CPU, FS) {
30 std::string CPUName = "generic";
Anton Korobeynikovf2c3e172009-05-03 12:57:15 +000031
32 // Parse features string.
Evan Cheng0ddff1b2011-07-07 07:07:08 +000033 ParseSubtargetFeatures(CPUName, FS);
Anton Korobeynikovf2c3e172009-05-03 12:57:15 +000034}
Evan Chengffc0e732011-07-09 05:47:46 +000035
36MCSubtargetInfo *createMSP430MCSubtargetInfo(StringRef TT, StringRef CPU,
37 StringRef FS) {
38 MCSubtargetInfo *X = new MCSubtargetInfo();
39 InitMSP430MCSubtargetInfo(X, CPU, FS);
40 return X;
41}
42
43extern "C" void LLVMInitializeMSP430MCSubtargetInfo() {
44 TargetRegistry::RegisterMCSubtargetInfo(TheMSP430Target,
45 createMSP430MCSubtargetInfo);
46}