forked from Hoernchen/Epiphany
-
Notifications
You must be signed in to change notification settings - Fork 2
/
EpiphanyTargetMachine.h
65 lines (51 loc) · 1.94 KB
/
EpiphanyTargetMachine.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
//=== EpiphanyTargetMachine.h - Define TargetMachine for Epiphany -*- 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 Epiphany specific subclass of TargetMachine.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_EPIPHANYTARGETMACHINE_H
#define LLVM_EPIPHANYTARGETMACHINE_H
#include "EpiphanyConfig.h"
#include "MCTargetDesc/EpiphanyABIInfo.h"
#include "EpiphanySubtarget.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetMachine.h"
namespace llvm {
class formatted_raw_ostream;
class EpiphanyRegisterInfo;
class EpiphanyTargetMachine : public LLVMTargetMachine {
std::unique_ptr<TargetLoweringObjectFile> TLOF;
EpiphanyABIInfo ABI;
EpiphanySubtarget Subtarget;
public:
EpiphanyTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
StringRef FS, const TargetOptions &Options,
Optional<Reloc::Model> RM, CodeModel::Model CM,
CodeGenOpt::Level OL);
~EpiphanyTargetMachine() override;
const EpiphanySubtarget *getSubtargetImpl() const {
return &Subtarget;
}
const EpiphanySubtarget *getSubtargetImpl(const Function &F) const override {
return &Subtarget;
};
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
TargetLoweringObjectFile *getObjFileLowering() const override {
return TLOF.get();
}
TargetIRAnalysis getTargetIRAnalysis() override;
const EpiphanyABIInfo &getABI() const { return ABI; }
const DataLayout *getDataLayout() const { return &DL; }
};
} // namespace llvm
#endif