1 //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the Sparc specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef SPARCTARGETMACHINE_H
15 #define SPARCTARGETMACHINE_H
17 #include "SparcInstrInfo.h"
18 #include "SparcISelLowering.h"
19 #include "SparcFrameLowering.h"
20 #include "SparcSelectionDAGInfo.h"
21 #include "SparcSubtarget.h"
22 #include "llvm/Target/TargetMachine.h"
23 #include "llvm/DataLayout.h"
24 #include "llvm/Target/TargetFrameLowering.h"
25 #include "llvm/Target/TargetTransformImpl.h"
29 class SparcTargetMachine : public LLVMTargetMachine {
30 SparcSubtarget Subtarget;
31 const DataLayout DL; // Calculates type size & alignment
32 SparcInstrInfo InstrInfo;
33 SparcTargetLowering TLInfo;
34 SparcSelectionDAGInfo TSInfo;
35 SparcFrameLowering FrameLowering;
36 ScalarTargetTransformImpl STTI;
37 VectorTargetTransformImpl VTTI;
39 SparcTargetMachine(const Target &T, StringRef TT,
40 StringRef CPU, StringRef FS, const TargetOptions &Options,
41 Reloc::Model RM, CodeModel::Model CM,
42 CodeGenOpt::Level OL, bool is64bit);
44 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
45 virtual const TargetFrameLowering *getFrameLowering() const {
46 return &FrameLowering;
48 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
49 virtual const SparcRegisterInfo *getRegisterInfo() const {
50 return &InstrInfo.getRegisterInfo();
52 virtual const SparcTargetLowering* getTargetLowering() const {
55 virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
58 virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
61 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
64 virtual const DataLayout *getDataLayout() const { return &DL; }
66 // Pass Pipeline Configuration
67 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
70 /// SparcV8TargetMachine - Sparc 32-bit target machine
72 class SparcV8TargetMachine : public SparcTargetMachine {
73 virtual void anchor();
75 SparcV8TargetMachine(const Target &T, StringRef TT,
76 StringRef CPU, StringRef FS,
77 const TargetOptions &Options,
78 Reloc::Model RM, CodeModel::Model CM,
79 CodeGenOpt::Level OL);
82 /// SparcV9TargetMachine - Sparc 64-bit target machine
84 class SparcV9TargetMachine : public SparcTargetMachine {
85 virtual void anchor();
87 SparcV9TargetMachine(const Target &T, StringRef TT,
88 StringRef CPU, StringRef FS,
89 const TargetOptions &Options,
90 Reloc::Model RM, CodeModel::Model CM,
91 CodeGenOpt::Level OL);
94 } // end namespace llvm