Fix part 1 of pr4682. PICADD is a 16-bit instruction even in thumb2 mode.
[llvm/avr.git] / lib / Target / Mips / MipsTargetMachine.h
blob5f5de75dab3e9af2600d732ee1159c7c76c928a3
1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -00--*- C++ -*-===//
2 //
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 Mips specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef MIPSTARGETMACHINE_H
15 #define MIPSTARGETMACHINE_H
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"
24 namespace llvm {
25 class formatted_raw_ostream;
27 class MipsTargetMachine : public LLVMTargetMachine {
28 MipsSubtarget Subtarget;
29 const TargetData DataLayout; // Calculates type size & alignment
30 MipsInstrInfo InstrInfo;
31 TargetFrameInfo FrameInfo;
32 MipsTargetLowering TLInfo;
34 protected:
35 virtual const TargetAsmInfo *createTargetAsmInfo() const;
37 public:
38 MipsTargetMachine(const Target &T, const std::string &TT,
39 const std::string &FS, bool isLittle);
41 virtual const MipsInstrInfo *getInstrInfo() const
42 { return &InstrInfo; }
43 virtual const TargetFrameInfo *getFrameInfo() const
44 { return &FrameInfo; }
45 virtual const MipsSubtarget *getSubtargetImpl() const
46 { return &Subtarget; }
47 virtual const TargetData *getTargetData() const
48 { return &DataLayout;}
50 virtual const MipsRegisterInfo *getRegisterInfo() const {
51 return &InstrInfo.getRegisterInfo();
54 virtual MipsTargetLowering *getTargetLowering() const {
55 return const_cast<MipsTargetLowering*>(&TLInfo);
58 // Pass Pipeline Configuration
59 virtual bool addInstSelector(PassManagerBase &PM,
60 CodeGenOpt::Level OptLevel);
61 virtual bool addPreEmitPass(PassManagerBase &PM,
62 CodeGenOpt::Level OptLevel);
65 /// MipselTargetMachine - Mipsel target machine.
66 ///
67 class MipselTargetMachine : public MipsTargetMachine {
68 public:
69 MipselTargetMachine(const Target &T, const std::string &TT,
70 const std::string &FS);
73 } // End llvm namespace
75 #endif