LLVM API Documentation

Mips16HardFloat.h
Go to the documentation of this file.
00001 //===---- Mips16HardFloat.h for Mips16 Hard Float                  --------===//
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 defines a phase which implements part of the floating point
00011 // interoperability between Mips16 and Mips32 code.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_LIB_TARGET_MIPS_MIPS16HARDFLOAT_H
00016 #define LLVM_LIB_TARGET_MIPS_MIPS16HARDFLOAT_H
00017 
00018 #include "MCTargetDesc/MipsMCTargetDesc.h"
00019 #include "MipsTargetMachine.h"
00020 #include "llvm/Pass.h"
00021 #include "llvm/Target/TargetMachine.h"
00022 
00023 using namespace llvm;
00024 
00025 namespace llvm {
00026 
00027 class Mips16HardFloat : public ModulePass {
00028 
00029 public:
00030   static char ID;
00031 
00032   Mips16HardFloat(MipsTargetMachine &TM_) : ModulePass(ID),
00033     TM(TM_), Subtarget(TM.getSubtarget<MipsSubtarget>()) {
00034   }
00035 
00036   const char *getPassName() const override {
00037     return "MIPS16 Hard Float Pass";
00038   }
00039 
00040   bool runOnModule(Module &M) override;
00041 
00042 protected:
00043   /// Keep a pointer to the MipsSubtarget around so that we can make the right
00044   /// decision when generating code for different targets.
00045   const TargetMachine &TM;
00046   const MipsSubtarget &Subtarget;
00047 
00048 };
00049 
00050 ModulePass *createMips16HardFloat(MipsTargetMachine &TM);
00051 
00052 }
00053 #endif