LLVM API Documentation

MipsTargetMachine.h
Go to the documentation of this file.
00001 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -----*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the Mips specific subclass of TargetMachine.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
00015 #define LLVM_LIB_TARGET_MIPS_MIPSTARGETMACHINE_H
00016 
00017 #include "MipsSubtarget.h"
00018 #include "llvm/CodeGen/Passes.h"
00019 #include "llvm/CodeGen/SelectionDAGISel.h"
00020 #include "llvm/Target/TargetFrameLowering.h"
00021 #include "llvm/Target/TargetMachine.h"
00022 
00023 namespace llvm {
00024 class formatted_raw_ostream;
00025 class MipsRegisterInfo;
00026 
00027 class MipsTargetMachine : public LLVMTargetMachine {
00028   MipsSubtarget *Subtarget;
00029   MipsSubtarget DefaultSubtarget;
00030   MipsSubtarget NoMips16Subtarget;
00031   MipsSubtarget Mips16Subtarget;
00032 
00033 public:
00034   MipsTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
00035                     const TargetOptions &Options, Reloc::Model RM,
00036                     CodeModel::Model CM, CodeGenOpt::Level OL, bool isLittle);
00037 
00038   virtual ~MipsTargetMachine() {}
00039 
00040   void addAnalysisPasses(PassManagerBase &PM) override;
00041 
00042   const MipsSubtarget *getSubtargetImpl() const override {
00043     if (Subtarget)
00044       return Subtarget;
00045     return &DefaultSubtarget;
00046   }
00047 
00048   /// \brief Reset the subtarget for the Mips target.
00049   void resetSubtarget(MachineFunction *MF);
00050 
00051   // Pass Pipeline Configuration
00052   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
00053 };
00054 
00055 /// MipsebTargetMachine - Mips32/64 big endian target machine.
00056 ///
00057 class MipsebTargetMachine : public MipsTargetMachine {
00058   virtual void anchor();
00059 public:
00060   MipsebTargetMachine(const Target &T, StringRef TT,
00061                       StringRef CPU, StringRef FS, const TargetOptions &Options,
00062                       Reloc::Model RM, CodeModel::Model CM,
00063                       CodeGenOpt::Level OL);
00064 };
00065 
00066 /// MipselTargetMachine - Mips32/64 little endian target machine.
00067 ///
00068 class MipselTargetMachine : public MipsTargetMachine {
00069   virtual void anchor();
00070 public:
00071   MipselTargetMachine(const Target &T, StringRef TT,
00072                       StringRef CPU, StringRef FS, const TargetOptions &Options,
00073                       Reloc::Model RM, CodeModel::Model CM,
00074                       CodeGenOpt::Level OL);
00075 };
00076 
00077 } // End llvm namespace
00078 
00079 #endif