1 //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- 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 Alpha-specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef ALPHA_TARGETMACHINE_H
15 #define ALPHA_TARGETMACHINE_H
17 #include "AlphaInstrInfo.h"
18 #include "AlphaISelLowering.h"
19 #include "AlphaFrameLowering.h"
20 #include "AlphaSelectionDAGInfo.h"
21 #include "AlphaSubtarget.h"
22 #include "llvm/Target/TargetMachine.h"
23 #include "llvm/Target/TargetData.h"
24 #include "llvm/Target/TargetFrameLowering.h"
30 class AlphaTargetMachine : public LLVMTargetMachine {
31 const TargetData DataLayout; // Calculates type size & alignment
32 AlphaInstrInfo InstrInfo;
33 AlphaFrameLowering FrameLowering;
34 AlphaSubtarget Subtarget;
35 AlphaTargetLowering TLInfo;
36 AlphaSelectionDAGInfo TSInfo;
39 AlphaTargetMachine(const Target &T, StringRef TT,
40 StringRef CPU, StringRef FS,
41 Reloc::Model RM, CodeModel::Model CM);
43 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
44 virtual const TargetFrameLowering *getFrameLowering() const {
45 return &FrameLowering;
47 virtual const AlphaSubtarget *getSubtargetImpl() const{ return &Subtarget; }
48 virtual const AlphaRegisterInfo *getRegisterInfo() const {
49 return &InstrInfo.getRegisterInfo();
51 virtual const AlphaTargetLowering* getTargetLowering() const {
54 virtual const AlphaSelectionDAGInfo* getSelectionDAGInfo() const {
57 virtual const TargetData *getTargetData() const { return &DataLayout; }
59 // Pass Pipeline Configuration
60 virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
61 virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
64 } // end namespace llvm