Implement a bunch more TargetSelectionDAGInfo infrastructure.
[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 "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetData.h"
19 #include "llvm/Target/TargetFrameInfo.h"
20 #include "AlphaInstrInfo.h"
21 #include "AlphaJITInfo.h"
22 #include "AlphaISelLowering.h"
23 #include "AlphaSelectionDAGInfo.h"
24 #include "AlphaSubtarget.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   TargetFrameInfo FrameInfo;
34   AlphaJITInfo JITInfo;
35   AlphaSubtarget Subtarget;
36   AlphaTargetLowering TLInfo;
37   AlphaSelectionDAGInfo TSInfo;
38
39 public:
40   AlphaTargetMachine(const Target &T, const std::string &TT,
41                      const std::string &FS);
42
43   virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
44   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
45   virtual const AlphaSubtarget   *getSubtargetImpl() const{ return &Subtarget; }
46   virtual const AlphaRegisterInfo *getRegisterInfo() const {
47     return &InstrInfo.getRegisterInfo();
48   }
49   virtual const AlphaTargetLowering* getTargetLowering() const {
50     return &TLInfo;
51   }
52   virtual const AlphaSelectionDAGInfo* getSelectionDAGInfo() const {
53     return &TSInfo;
54   }
55   virtual const TargetData       *getTargetData() const { return &DataLayout; }
56   virtual AlphaJITInfo* getJITInfo() {
57     return &JITInfo;
58   }
59
60   // Pass Pipeline Configuration
61   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
62   virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
63   virtual bool addCodeEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel,
64                               JITCodeEmitter &JCE);
65 };
66
67 } // end namespace llvm
68
69 #endif