SparcTargetMachine.h revision a69571c7991813c93cba64e88eced6899ce93d81
1//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file was developed by the LLVM research group and is distributed under 6// the University of Illinois Open Source License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file declares the Sparc specific subclass of TargetMachine. 11// 12//===----------------------------------------------------------------------===// 13 14#ifndef SPARCTARGETMACHINE_H 15#define SPARCTARGETMACHINE_H 16 17#include "llvm/Target/TargetMachine.h" 18#include "llvm/Target/TargetFrameInfo.h" 19#include "llvm/PassManager.h" 20#include "SparcInstrInfo.h" 21#include "SparcSubtarget.h" 22 23namespace llvm { 24 25class Module; 26 27class SparcTargetMachine : public TargetMachine { 28 const TargetData DataLayout; // Calculates type size & alignment 29 SparcSubtarget Subtarget; 30 SparcInstrInfo InstrInfo; 31 TargetFrameInfo FrameInfo; 32public: 33 SparcTargetMachine(const Module &M, const std::string &FS); 34 35 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; } 36 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } 37 virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } 38 virtual const MRegisterInfo *getRegisterInfo() const { 39 return &InstrInfo.getRegisterInfo(); 40 } 41 virtual const TargetData *getTargetData() const { return &DataLayout; } 42 static unsigned getModuleMatchQuality(const Module &M); 43 44 virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, 45 CodeGenFileType FileType, bool Fast); 46}; 47 48} // end namespace llvm 49 50#endif 51