forked from cgeyer/llvm-cbg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcbgTargetMachine.h
78 lines (67 loc) · 2.6 KB
/
cbgTargetMachine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//===-- cbgTargetMachine.h - Define TargetMachine for cbg ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the cbg specific subclass of TargetMachine.
//
//===----------------------------------------------------------------------===//
#ifndef CBGTARGETMACHINE_H
#define CBGTARGETMACHINE_H
#include "cbgInstrInfo.h"
#include "cbgISelLowering.h"
#include "cbgFrameLowering.h"
#include "cbgSelectionDAGInfo.h"
#include "cbgSubtarget.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameLowering.h"
namespace llvm {
class cbgTargetMachine : public LLVMTargetMachine {
cbgSubtarget Subtarget;
const TargetData DataLayout; // Calculates type size & alignment
cbgTargetLowering TLInfo;
cbgSelectionDAGInfo TSInfo;
cbgInstrInfo InstrInfo;
cbgFrameLowering FrameLowering;
public:
cbgTargetMachine(const Target &T, const std::string &TT,
const std::string &FS);
virtual const cbgInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameLowering *getFrameLowering() const {
return &FrameLowering;
}
virtual const cbgSubtarget *getSubtargetImpl() const{ return &Subtarget; }
virtual const cbgRegisterInfo *getRegisterInfo() const {
return &InstrInfo.getRegisterInfo();
}
virtual const cbgTargetLowering* getTargetLowering() const {
return &TLInfo;
}
virtual const cbgSelectionDAGInfo* getSelectionDAGInfo() const {
return &TSInfo;
}
virtual const TargetData *getTargetData() const { return &DataLayout; }
/*virtual bool addPassesToEmitFile(PassManagerBase &PM,
formatted_raw_ostream &Out,
CodeGenFileType FileType,
CodeGenOpt::Level,
bool DisableVerify = true);
virtual bool addPreISel(PassManagerBase &PM, CodeGenOpt::Level OptLevel);*/
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
};
/// cbgV8TargetMachine - cbg 32-bit target machine
///
class cbgV8TargetMachine : public cbgTargetMachine {
public:
cbgV8TargetMachine(const Target &T, const std::string &TT,
const std::string &FS);
};
} // end namespace llvm
#endif