blob: 30d46d389ee519ba1b5e5bec5d2ec1610fc7c578 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- MSP430Subtarget.h - Define Subtarget for the MSP430 ----*- C++ -*--===//
Anton Korobeynikov10138002009-05-03 12:57:15 +00002//
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 Cheng0d639a22011-07-01 21:01:15 +000010// This file declares the MSP430 specific subclass of TargetSubtargetInfo.
Anton Korobeynikov10138002009-05-03 12:57:15 +000011//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H
15#define LLVM_LIB_TARGET_MSP430_MSP430SUBTARGET_H
Anton Korobeynikov10138002009-05-03 12:57:15 +000016
Eric Christopher1f86cca2014-06-27 01:14:54 +000017#include "MSP430FrameLowering.h"
Eric Christopher1f86cca2014-06-27 01:14:54 +000018#include "MSP430ISelLowering.h"
Chandler Carruthd9903882015-01-14 11:23:27 +000019#include "MSP430InstrInfo.h"
Eric Christopher1f86cca2014-06-27 01:14:54 +000020#include "MSP430RegisterInfo.h"
21#include "MSP430SelectionDAGInfo.h"
22#include "llvm/IR/DataLayout.h"
Evan Cheng0d639a22011-07-01 21:01:15 +000023#include "llvm/Target/TargetSubtargetInfo.h"
Craig Topperb25fda92012-03-17 18:46:09 +000024#include <string>
Anton Korobeynikov10138002009-05-03 12:57:15 +000025
Evan Cheng54b68e32011-07-01 20:45:01 +000026#define GET_SUBTARGETINFO_HEADER
Evan Chengc9c090d2011-07-01 22:36:09 +000027#include "MSP430GenSubtargetInfo.inc"
Evan Cheng54b68e32011-07-01 20:45:01 +000028
Anton Korobeynikov10138002009-05-03 12:57:15 +000029namespace llvm {
Evan Cheng1a72add62011-07-07 07:07:08 +000030class StringRef;
Anton Korobeynikov10138002009-05-03 12:57:15 +000031
Evan Cheng54b68e32011-07-01 20:45:01 +000032class MSP430Subtarget : public MSP430GenSubtargetInfo {
David Blaikiea379b1812011-12-20 02:50:00 +000033 virtual void anchor();
Anton Korobeynikov10138002009-05-03 12:57:15 +000034 bool ExtendedInsts;
Eric Christopher1f86cca2014-06-27 01:14:54 +000035 MSP430FrameLowering FrameLowering;
36 MSP430InstrInfo InstrInfo;
37 MSP430TargetLowering TLInfo;
38 MSP430SelectionDAGInfo TSInfo;
39
Anton Korobeynikov10138002009-05-03 12:57:15 +000040public:
41 /// This constructor initializes the data members to match that
Daniel Dunbar31b44e82009-08-02 22:11:08 +000042 /// of the specified triple.
Anton Korobeynikov10138002009-05-03 12:57:15 +000043 ///
Evan Chengfe6e4052011-06-30 01:53:36 +000044 MSP430Subtarget(const std::string &TT, const std::string &CPU,
Eric Christopher1f86cca2014-06-27 01:14:54 +000045 const std::string &FS, const TargetMachine &TM);
46
47 MSP430Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
Anton Korobeynikov10138002009-05-03 12:57:15 +000048
49 /// ParseSubtargetFeatures - Parses features string setting specified
50 /// subtarget options. Definition of function is auto generated by tblgen.
Evan Cheng1a72add62011-07-07 07:07:08 +000051 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
Eric Christopher1f86cca2014-06-27 01:14:54 +000052
Eric Christopherd9134482014-08-04 21:25:23 +000053 const TargetFrameLowering *getFrameLowering() const override {
54 return &FrameLowering;
55 }
56 const MSP430InstrInfo *getInstrInfo() const override { return &InstrInfo; }
Eric Christopherd9134482014-08-04 21:25:23 +000057 const TargetRegisterInfo *getRegisterInfo() const override {
Eric Christopher1f86cca2014-06-27 01:14:54 +000058 return &InstrInfo.getRegisterInfo();
59 }
Eric Christopherd9134482014-08-04 21:25:23 +000060 const MSP430TargetLowering *getTargetLowering() const override {
61 return &TLInfo;
62 }
63 const MSP430SelectionDAGInfo *getSelectionDAGInfo() const override {
64 return &TSInfo;
65 }
Anton Korobeynikov10138002009-05-03 12:57:15 +000066};
67} // End llvm namespace
68
69#endif // LLVM_TARGET_MSP430_SUBTARGET_H