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 "SparcFrameLowering.h"
18 #include "SparcISelLowering.h"
19 #include "SparcInstrInfo.h"
20 #include "SparcSelectionDAGInfo.h"
21 #include "SparcSubtarget.h"
22 #include "llvm/IR/DataLayout.h"
23 #include "llvm/Target/TargetFrameLowering.h"
24 #include "llvm/Target/TargetMachine.h"
28 class SparcTargetMachine : public LLVMTargetMachine {
29 SparcSubtarget Subtarget;
30 const DataLayout DL; // Calculates type size & alignment
31 SparcInstrInfo InstrInfo;
32 SparcTargetLowering TLInfo;
33 SparcSelectionDAGInfo TSInfo;
34 SparcFrameLowering FrameLowering;
36 SparcTargetMachine(const Target &T, StringRef TT,
37 StringRef CPU, StringRef FS, const TargetOptions &Options,
38 Reloc::Model RM, CodeModel::Model CM,
39 CodeGenOpt::Level OL, bool is64bit);
41 virtual const SparcInstrInfo *getInstrInfo() const { return &InstrInfo; }
42 virtual const TargetFrameLowering *getFrameLowering() const {
43 return &FrameLowering;
45 virtual const SparcSubtarget *getSubtargetImpl() const{ return &Subtarget; }
46 virtual const SparcRegisterInfo *getRegisterInfo() const {
47 return &InstrInfo.getRegisterInfo();
49 virtual const SparcTargetLowering* getTargetLowering() const {
52 virtual const SparcSelectionDAGInfo* getSelectionDAGInfo() const {
55 virtual const DataLayout *getDataLayout() const { return &DL; }
57 // Pass Pipeline Configuration
58 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
61 /// SparcV8TargetMachine - Sparc 32-bit target machine
63 class SparcV8TargetMachine : public SparcTargetMachine {
64 virtual void anchor();
66 SparcV8TargetMachine(const Target &T, StringRef TT,
67 StringRef CPU, StringRef FS,
68 const TargetOptions &Options,
69 Reloc::Model RM, CodeModel::Model CM,
70 CodeGenOpt::Level OL);
73 /// SparcV9TargetMachine - Sparc 64-bit target machine
75 class SparcV9TargetMachine : public SparcTargetMachine {
76 virtual void anchor();
78 SparcV9TargetMachine(const Target &T, StringRef TT,
79 StringRef CPU, StringRef FS,
80 const TargetOptions &Options,
81 Reloc::Model RM, CodeModel::Model CM,
82 CodeGenOpt::Level OL);
85 } // end namespace llvm