blob: c3428be48f5920ed399f1afb68101424ba2d4466 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the Mips specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MIPSTARGETMACHINE_H
15#define MIPSTARGETMACHINE_H
16
17#include "MipsSubtarget.h"
18#include "MipsInstrInfo.h"
19#include "MipsISelLowering.h"
20#include "llvm/Target/TargetMachine.h"
21#include "llvm/Target/TargetData.h"
22#include "llvm/Target/TargetFrameInfo.h"
23
24namespace llvm {
David Greene302008d2009-07-14 20:18:05 +000025 class formatted_raw_ostream;
Owen Anderson847b99b2008-08-21 00:14:44 +000026
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027 class MipsTargetMachine : public LLVMTargetMachine {
28 MipsSubtarget Subtarget;
29 const TargetData DataLayout; // Calculates type size & alignment
30 MipsInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
32 MipsTargetLowering TLInfo;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000033 public:
Eli Friedman532ba1e2009-08-03 02:22:28 +000034 MipsTargetMachine(const Target &T, const std::string &TT,
Daniel Dunbarf5c2b852009-08-02 23:37:13 +000035 const std::string &FS, bool isLittle);
Chris Lattner46f85e52009-06-16 22:38:04 +000036
Dan Gohmanf17a25c2007-07-18 16:29:46 +000037 virtual const MipsInstrInfo *getInstrInfo() const
38 { return &InstrInfo; }
39 virtual const TargetFrameInfo *getFrameInfo() const
40 { return &FrameInfo; }
Dan Gohmanb41dfba2008-05-14 01:58:56 +000041 virtual const MipsSubtarget *getSubtargetImpl() const
Dan Gohmanf17a25c2007-07-18 16:29:46 +000042 { return &Subtarget; }
43 virtual const TargetData *getTargetData() const
44 { return &DataLayout;}
45
Dan Gohmanb41dfba2008-05-14 01:58:56 +000046 virtual const MipsRegisterInfo *getRegisterInfo() const {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000047 return &InstrInfo.getRegisterInfo();
48 }
49
50 virtual MipsTargetLowering *getTargetLowering() const {
51 return const_cast<MipsTargetLowering*>(&TLInfo);
52 }
53
Dan Gohmanf17a25c2007-07-18 16:29:46 +000054 // Pass Pipeline Configuration
Bill Wendling5ed22ac2009-04-29 23:29:43 +000055 virtual bool addInstSelector(PassManagerBase &PM,
56 CodeGenOpt::Level OptLevel);
57 virtual bool addPreEmitPass(PassManagerBase &PM,
58 CodeGenOpt::Level OptLevel);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000059 };
Bruno Cardoso Lopesdb260942008-06-04 01:45:25 +000060
61/// MipselTargetMachine - Mipsel target machine.
62///
63class MipselTargetMachine : public MipsTargetMachine {
64public:
Eli Friedman532ba1e2009-08-03 02:22:28 +000065 MipselTargetMachine(const Target &T, const std::string &TT,
66 const std::string &FS);
Bruno Cardoso Lopesdb260942008-06-04 01:45:25 +000067};
68
Dan Gohmanf17a25c2007-07-18 16:29:46 +000069} // End llvm namespace
70
71#endif