blob: cd671cf3d064aa65c644525a42d4ab962d0bbf21 [file] [log] [blame]
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +00001//===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +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 Greene71847812009-07-14 20:18:05 +000025 class formatted_raw_ostream;
Owen Andersoncb371882008-08-21 00:14:44 +000026
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +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;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000033 public:
Eli Friedmane2c74082009-08-03 02:22:28 +000034 MipsTargetMachine(const Target &T, const std::string &TT,
Daniel Dunbare28039c2009-08-02 23:37:13 +000035 const std::string &FS, bool isLittle);
Chris Lattnere8f10182009-06-16 22:38:04 +000036
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000037 virtual const MipsInstrInfo *getInstrInfo() const
38 { return &InstrInfo; }
39 virtual const TargetFrameInfo *getFrameInfo() const
40 { return &FrameInfo; }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000041 virtual const MipsSubtarget *getSubtargetImpl() const
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000042 { return &Subtarget; }
43 virtual const TargetData *getTargetData() const
44 { return &DataLayout;}
45
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000046 virtual const MipsRegisterInfo *getRegisterInfo() const {
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000047 return &InstrInfo.getRegisterInfo();
48 }
49
Dan Gohmand858e902010-04-17 15:26:15 +000050 virtual const MipsTargetLowering *getTargetLowering() const {
51 return &TLInfo;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000052 }
53
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000054 // Pass Pipeline Configuration
Bill Wendling98a366d2009-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);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000059 };
Bruno Cardoso Lopesd2947ee2008-06-04 01:45:25 +000060
61/// MipselTargetMachine - Mipsel target machine.
62///
63class MipselTargetMachine : public MipsTargetMachine {
64public:
Eli Friedmane2c74082009-08-03 02:22:28 +000065 MipselTargetMachine(const Target &T, const std::string &TT,
66 const std::string &FS);
Bruno Cardoso Lopesd2947ee2008-06-04 01:45:25 +000067};
68
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000069} // End llvm namespace
70
71#endif