LLVM API Documentation

SparcTargetMachine.h

Go to the documentation of this file.
00001 //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the Sparc specific subclass of TargetMachine.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef SPARCTARGETMACHINE_H
00015 #define SPARCTARGETMACHINE_H
00016 
00017 #include "llvm/Target/TargetMachine.h"
00018 #include "llvm/Target/TargetFrameInfo.h"
00019 #include "llvm/PassManager.h"
00020 #include "SparcInstrInfo.h"
00021 #include "SparcSubtarget.h"
00022 
00023 namespace llvm {
00024 
00025 class Module;
00026 
00027 class SparcTargetMachine : public TargetMachine {
00028   SparcSubtarget Subtarget;
00029   SparcInstrInfo InstrInfo;
00030   TargetFrameInfo FrameInfo;
00031 public:
00032   SparcTargetMachine(const Module &M, const std::string &FS);
00033 
00034   virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
00035   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
00036   virtual const TargetSubtarget  *getSubtargetImpl() const{ return &Subtarget; }
00037   virtual const MRegisterInfo *getRegisterInfo() const {
00038     return &InstrInfo.getRegisterInfo();
00039   }
00040 
00041   static unsigned getModuleMatchQuality(const Module &M);
00042 
00043   virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,
00044                                    CodeGenFileType FileType, bool Fast);
00045 };
00046 
00047 } // end namespace llvm
00048 
00049 #endif