blob: 93d2f63d530773da2ea9b0308332cb5d1f25002b [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"
Anton Korobeynikov33464912010-11-15 00:06:54 +000020#include "MipsFrameInfo.h"
Dan Gohmanff7a5622010-05-11 17:31:57 +000021#include "MipsSelectionDAGInfo.h"
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000022#include "llvm/Target/TargetMachine.h"
23#include "llvm/Target/TargetData.h"
24#include "llvm/Target/TargetFrameInfo.h"
25
26namespace llvm {
David Greene71847812009-07-14 20:18:05 +000027 class formatted_raw_ostream;
Anton Korobeynikov33464912010-11-15 00:06:54 +000028
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000029 class MipsTargetMachine : public LLVMTargetMachine {
30 MipsSubtarget Subtarget;
31 const TargetData DataLayout; // Calculates type size & alignment
32 MipsInstrInfo InstrInfo;
Anton Korobeynikov33464912010-11-15 00:06:54 +000033 MipsFrameInfo FrameInfo;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000034 MipsTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000035 MipsSelectionDAGInfo TSInfo;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000036 public:
Eli Friedmane2c74082009-08-03 02:22:28 +000037 MipsTargetMachine(const Target &T, const std::string &TT,
Daniel Dunbare28039c2009-08-02 23:37:13 +000038 const std::string &FS, bool isLittle);
Anton Korobeynikov33464912010-11-15 00:06:54 +000039
40 virtual const MipsInstrInfo *getInstrInfo() const
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000041 { return &InstrInfo; }
Anton Korobeynikov33464912010-11-15 00:06:54 +000042 virtual const TargetFrameInfo *getFrameInfo() const
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000043 { return &FrameInfo; }
Anton Korobeynikov33464912010-11-15 00:06:54 +000044 virtual const MipsSubtarget *getSubtargetImpl() const
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000045 { return &Subtarget; }
Anton Korobeynikov33464912010-11-15 00:06:54 +000046 virtual const TargetData *getTargetData() const
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000047 { return &DataLayout;}
48
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000049 virtual const MipsRegisterInfo *getRegisterInfo() const {
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000050 return &InstrInfo.getRegisterInfo();
51 }
52
Anton Korobeynikov33464912010-11-15 00:06:54 +000053 virtual const MipsTargetLowering *getTargetLowering() const {
Dan Gohmand858e902010-04-17 15:26:15 +000054 return &TLInfo;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000055 }
56
Dan Gohmanff7a5622010-05-11 17:31:57 +000057 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
58 return &TSInfo;
59 }
60
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000061 // Pass Pipeline Configuration
Bill Wendling98a366d2009-04-29 23:29:43 +000062 virtual bool addInstSelector(PassManagerBase &PM,
63 CodeGenOpt::Level OptLevel);
64 virtual bool addPreEmitPass(PassManagerBase &PM,
65 CodeGenOpt::Level OptLevel);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000066 };
Bruno Cardoso Lopesd2947ee2008-06-04 01:45:25 +000067
68/// MipselTargetMachine - Mipsel target machine.
69///
70class MipselTargetMachine : public MipsTargetMachine {
71public:
Eli Friedmane2c74082009-08-03 02:22:28 +000072 MipselTargetMachine(const Target &T, const std::string &TT,
73 const std::string &FS);
Bruno Cardoso Lopesd2947ee2008-06-04 01:45:25 +000074};
75
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000076} // End llvm namespace
77
78#endif