blob: d63976fcfc3e7bb1114749f70795be19f6b02565 [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"
Dan Gohmanff7a5622010-05-11 17:31:57 +000020#include "MipsSelectionDAGInfo.h"
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000021#include "llvm/Target/TargetMachine.h"
22#include "llvm/Target/TargetData.h"
23#include "llvm/Target/TargetFrameInfo.h"
24
25namespace llvm {
David Greene71847812009-07-14 20:18:05 +000026 class formatted_raw_ostream;
Owen Andersoncb371882008-08-21 00:14:44 +000027
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000028 class MipsTargetMachine : public LLVMTargetMachine {
29 MipsSubtarget Subtarget;
30 const TargetData DataLayout; // Calculates type size & alignment
31 MipsInstrInfo InstrInfo;
32 TargetFrameInfo FrameInfo;
33 MipsTargetLowering TLInfo;
Dan Gohmanff7a5622010-05-11 17:31:57 +000034 MipsSelectionDAGInfo TSInfo;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000035 public:
Eli Friedmane2c74082009-08-03 02:22:28 +000036 MipsTargetMachine(const Target &T, const std::string &TT,
Daniel Dunbare28039c2009-08-02 23:37:13 +000037 const std::string &FS, bool isLittle);
Chris Lattnere8f10182009-06-16 22:38:04 +000038
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000039 virtual const MipsInstrInfo *getInstrInfo() const
40 { return &InstrInfo; }
41 virtual const TargetFrameInfo *getFrameInfo() const
42 { return &FrameInfo; }
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000043 virtual const MipsSubtarget *getSubtargetImpl() const
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000044 { return &Subtarget; }
45 virtual const TargetData *getTargetData() const
46 { return &DataLayout;}
47
Dan Gohmanc9f5f3f2008-05-14 01:58:56 +000048 virtual const MipsRegisterInfo *getRegisterInfo() const {
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000049 return &InstrInfo.getRegisterInfo();
50 }
51
Dan Gohmand858e902010-04-17 15:26:15 +000052 virtual const MipsTargetLowering *getTargetLowering() const {
53 return &TLInfo;
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000054 }
55
Dan Gohmanff7a5622010-05-11 17:31:57 +000056 virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
57 return &TSInfo;
58 }
59
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000060 // Pass Pipeline Configuration
Bill Wendling98a366d2009-04-29 23:29:43 +000061 virtual bool addInstSelector(PassManagerBase &PM,
62 CodeGenOpt::Level OptLevel);
63 virtual bool addPreEmitPass(PassManagerBase &PM,
64 CodeGenOpt::Level OptLevel);
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000065 };
Bruno Cardoso Lopesd2947ee2008-06-04 01:45:25 +000066
67/// MipselTargetMachine - Mipsel target machine.
68///
69class MipselTargetMachine : public MipsTargetMachine {
70public:
Eli Friedmane2c74082009-08-03 02:22:28 +000071 MipselTargetMachine(const Target &T, const std::string &TT,
72 const std::string &FS);
Bruno Cardoso Lopesd2947ee2008-06-04 01:45:25 +000073};
74
Bruno Cardoso Lopes972f5892007-06-06 07:42:06 +000075} // End llvm namespace
76
77#endif