Implement a bunch more TargetSelectionDAGInfo infrastructure.
[oota-llvm.git] / lib / Target / XCore / XCoreTargetMachine.h
1 //===-- XCoreTargetMachine.h - Define TargetMachine for XCore ---*- 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 XCore specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef XCORETARGETMACHINE_H
15 #define XCORETARGETMACHINE_H
16
17 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetData.h"
19 #include "XCoreFrameInfo.h"
20 #include "XCoreSubtarget.h"
21 #include "XCoreInstrInfo.h"
22 #include "XCoreISelLowering.h"
23 #include "XCoreSelectionDAGInfo.h"
24
25 namespace llvm {
26
27 class XCoreTargetMachine : public LLVMTargetMachine {
28   XCoreSubtarget Subtarget;
29   const TargetData DataLayout;       // Calculates type size & alignment
30   XCoreInstrInfo InstrInfo;
31   XCoreFrameInfo FrameInfo;
32   XCoreTargetLowering TLInfo;
33   XCoreSelectionDAGInfo TSInfo;
34 public:
35   XCoreTargetMachine(const Target &T, const std::string &TT,
36                      const std::string &FS);
37
38   virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; }
39   virtual const XCoreFrameInfo *getFrameInfo() const { return &FrameInfo; }
40   virtual const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; }
41   virtual const XCoreTargetLowering *getTargetLowering() const {
42     return &TLInfo;
43   }
44
45   virtual const XCoreSelectionDAGInfo* getSelectionDAGInfo() const {
46     return &TSInfo;
47   }
48
49   virtual const TargetRegisterInfo *getRegisterInfo() const {
50     return &InstrInfo.getRegisterInfo();
51   }
52   virtual const TargetData       *getTargetData() const { return &DataLayout; }
53
54   // Pass Pipeline Configuration
55   virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
56 };
57
58 } // end namespace llvm
59
60 #endif