1//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- 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 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/TargetData.h" 19#include "llvm/Target/TargetFrameInfo.h" 20#include "SparcInstrInfo.h" 21#include "SparcSubtarget.h" 22#include "SparcISelLowering.h" 23 24namespace llvm { 25 26class SparcTargetMachine : public LLVMTargetMachine {
| 1//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- 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 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/TargetData.h" 19#include "llvm/Target/TargetFrameInfo.h" 20#include "SparcInstrInfo.h" 21#include "SparcSubtarget.h" 22#include "SparcISelLowering.h" 23 24namespace llvm { 25 26class SparcTargetMachine : public LLVMTargetMachine {
|
27 const TargetData DataLayout; // Calculates type size & alignment
| |
28 SparcSubtarget Subtarget;
| 27 SparcSubtarget Subtarget;
|
| 28 const TargetData DataLayout; // Calculates type size & alignment
|
29 SparcTargetLowering TLInfo; 30 SparcInstrInfo InstrInfo; 31 TargetFrameInfo FrameInfo; 32public: 33 SparcTargetMachine(const Target &T, const std::string &TT,
| 29 SparcTargetLowering TLInfo; 30 SparcInstrInfo InstrInfo; 31 TargetFrameInfo FrameInfo; 32public: 33 SparcTargetMachine(const Target &T, const std::string &TT,
|
34 const std::string &FS);
| 34 const std::string &FS, bool is64bit);
|
35 36 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; } 37 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } 38 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; } 39 virtual const SparcRegisterInfo *getRegisterInfo() const { 40 return &InstrInfo.getRegisterInfo(); 41 } 42 virtual SparcTargetLowering* getTargetLowering() const { 43 return const_cast<SparcTargetLowering*>(&TLInfo); 44 } 45 virtual const TargetData *getTargetData() const { return &DataLayout; } 46 47 // Pass Pipeline Configuration 48 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel); 49 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel); 50}; 51
| 35 36 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; } 37 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } 38 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; } 39 virtual const SparcRegisterInfo *getRegisterInfo() const { 40 return &InstrInfo.getRegisterInfo(); 41 } 42 virtual SparcTargetLowering* getTargetLowering() const { 43 return const_cast<SparcTargetLowering*>(&TLInfo); 44 } 45 virtual const TargetData *getTargetData() const { return &DataLayout; } 46 47 // Pass Pipeline Configuration 48 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel); 49 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel); 50}; 51
|
| 52/// SparcV8TargetMachine - Sparc 32-bit target machine 53/// 54class SparcV8TargetMachine : public SparcTargetMachine { 55public: 56 SparcV8TargetMachine(const Target &T, const std::string &TT, 57 const std::string &FS); 58}; 59 60/// SparcV9TargetMachine - Sparc 64-bit target machine 61/// 62class SparcV9TargetMachine : public SparcTargetMachine { 63public: 64 SparcV9TargetMachine(const Target &T, const std::string &TT, 65 const std::string &FS); 66}; 67
|
52} // end namespace llvm 53 54#endif
| 68} // end namespace llvm 69 70#endif
|