]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/lib/Target/Blackfin/BlackfinTargetMachine.h
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / lib / Target / Blackfin / BlackfinTargetMachine.h
1 //===-- BlackfinTargetMachine.h - TargetMachine for Blackfin ----*- 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 Blackfin specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef BLACKFINTARGETMACHINE_H
15 #define BLACKFINTARGETMACHINE_H
16
17 #include "BlackfinInstrInfo.h"
18 #include "BlackfinIntrinsicInfo.h"
19 #include "BlackfinISelLowering.h"
20 #include "BlackfinFrameLowering.h"
21 #include "BlackfinSubtarget.h"
22 #include "BlackfinSelectionDAGInfo.h"
23 #include "llvm/Target/TargetMachine.h"
24 #include "llvm/Target/TargetData.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26
27 namespace llvm {
28
29   class BlackfinTargetMachine : public LLVMTargetMachine {
30     const TargetData DataLayout;
31     BlackfinSubtarget Subtarget;
32     BlackfinTargetLowering TLInfo;
33     BlackfinSelectionDAGInfo TSInfo;
34     BlackfinInstrInfo InstrInfo;
35     BlackfinFrameLowering FrameLowering;
36     BlackfinIntrinsicInfo IntrinsicInfo;
37   public:
38     BlackfinTargetMachine(const Target &T, const std::string &TT,
39                           const std::string &CPU, const std::string &FS);
40
41     virtual const BlackfinInstrInfo *getInstrInfo() const { return &InstrInfo; }
42     virtual const TargetFrameLowering *getFrameLowering() const {
43       return &FrameLowering;
44     }
45     virtual const BlackfinSubtarget *getSubtargetImpl() const {
46       return &Subtarget;
47     }
48     virtual const BlackfinRegisterInfo *getRegisterInfo() const {
49       return &InstrInfo.getRegisterInfo();
50     }
51     virtual const BlackfinTargetLowering* getTargetLowering() const {
52       return &TLInfo;
53     }
54     virtual const BlackfinSelectionDAGInfo* getSelectionDAGInfo() const {
55       return &TSInfo;
56     }
57     virtual const TargetData *getTargetData() const { return &DataLayout; }
58     virtual bool addInstSelector(PassManagerBase &PM,
59                                  CodeGenOpt::Level OptLevel);
60     const TargetIntrinsicInfo *getIntrinsicInfo() const {
61       return &IntrinsicInfo;
62     }
63   };
64
65 } // end namespace llvm
66
67 #endif