blob: 4935b80cfdd99d5a9a596fbffa1c1afe07e730c9 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- MSP430TargetMachine.h - Define TargetMachine for 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//
10// This file declares the MSP430 specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000015#ifndef LLVM_LIB_TARGET_MSP430_MSP430TARGETMACHINE_H
16#define LLVM_LIB_TARGET_MSP430_MSP430TARGETMACHINE_H
Anton Korobeynikov10138002009-05-03 12:57:15 +000017
Anton Korobeynikov10138002009-05-03 12:57:15 +000018#include "MSP430Subtarget.h"
David Blaikie1be62f02017-11-03 22:32:11 +000019#include "llvm/CodeGen/TargetFrameLowering.h"
Anton Korobeynikov10138002009-05-03 12:57:15 +000020#include "llvm/Target/TargetMachine.h"
21
22namespace llvm {
23
24/// MSP430TargetMachine
25///
Matthias Braunbb8507e2017-10-12 22:57:28 +000026class MSP430TargetMachine : public LLVMTargetMachine {
Aditya Nandakumara2719322014-11-13 09:26:31 +000027 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Anton Korobeynikov10138002009-05-03 12:57:15 +000028 MSP430Subtarget Subtarget;
Anton Korobeynikov10138002009-05-03 12:57:15 +000029
Anton Korobeynikov10138002009-05-03 12:57:15 +000030public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000031 MSP430TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
32 StringRef FS, const TargetOptions &Options,
Rafael Espindola79e238a2017-08-03 02:16:21 +000033 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
34 CodeGenOpt::Level OL, bool JIT);
Reid Kleckner357600e2014-11-20 23:37:18 +000035 ~MSP430TargetMachine() override;
Anton Korobeynikov10138002009-05-03 12:57:15 +000036
Eric Christopher4d0f35a2015-03-21 04:22:23 +000037 const MSP430Subtarget *getSubtargetImpl(const Function &F) const override {
Eric Christopher1f86cca2014-06-27 01:14:54 +000038 return &Subtarget;
39 }
Craig Topper6f9e59e2014-04-29 07:58:09 +000040 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Aditya Nandakumara2719322014-11-13 09:26:31 +000041
42 TargetLoweringObjectFile *getObjFileLowering() const override {
43 return TLOF.get();
44 }
Anton Korobeynikov10138002009-05-03 12:57:15 +000045}; // MSP430TargetMachine.
46
47} // end namespace llvm
48
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000049#endif