First step of huge frame-related refactoring: move emit{Prologue,Epilogue} out of...
[oota-llvm.git] / lib / Target / Alpha / AlphaTargetMachine.h
1 //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- 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 Alpha-specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef ALPHA_TARGETMACHINE_H
15 #define ALPHA_TARGETMACHINE_H
16
17 #include "AlphaInstrInfo.h"
18 #include "AlphaISelLowering.h"
19 #include "AlphaFrameInfo.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/TargetFrameInfo.h"
25
26 namespace llvm {
27
28 class GlobalValue;
29
30 class AlphaTargetMachine : public LLVMTargetMachine {
31   const TargetData DataLayout;       // Calculates type size & alignment
32   AlphaInstrInfo InstrInfo;
33   AlphaFrameInfo FrameInfo;
34   AlphaSubtarget Subtarget;
35   AlphaTargetLowering TLInfo;
36   AlphaSelectionDAGInfo TSInfo;
37
38 public:
39   AlphaTargetMachine(const Target &T, const std::string &TT,
40                      const std::string &FS);
41
42   virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
43   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
44   virtual const AlphaSubtarget   *getSubtargetImpl() const{ return &Subtarget; }
45   virtual const AlphaRegisterInfo *getRegisterInfo() const {
46     return &InstrInfo.getRegisterInfo();
47   }
48   virtual const AlphaTargetLowering* getTargetLowering() const {
49     return &TLInfo;
50   }
51   virtual const AlphaSelectionDAGInfo* getSelectionDAGInfo() const {
52     return &TSInfo;
53   }
54   virtual const TargetData       *getTargetData() const { return &DataLayout; }
55
56   // Pass Pipeline Configuration
57   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
58   virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
59 };
60
61 } // end namespace llvm
62
63 #endif