blob: acd41f920b53623017d54fd75ee8573bd647a8ff [file] [log] [blame]
Tony Linthicum1213a7a2011-12-12 21:14:40 +00001//=-- HexagonTargetMachine.h - Define TargetMachine for Hexagon ---*- 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 Hexagon specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETMACHINE_H
15#define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETMACHINE_H
Tony Linthicum1213a7a2011-12-12 21:14:40 +000016
Chandler Carruth802d7552012-12-04 07:12:27 +000017#include "HexagonInstrInfo.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000018#include "HexagonSubtarget.h"
Krzysztof Parzyszek21dc8bd2015-12-18 20:19:30 +000019#include "HexagonTargetObjectFile.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000020#include "llvm/Target/TargetMachine.h"
Tony Linthicum1213a7a2011-12-12 21:14:40 +000021
22namespace llvm {
23
24class Module;
25
Matthias Braunbb8507e2017-10-12 22:57:28 +000026class HexagonTargetMachine : public LLVMTargetMachine {
Aditya Nandakumara2719322014-11-13 09:26:31 +000027 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Krzysztof Parzyszek73e66f32015-08-05 18:35:37 +000028 mutable StringMap<std::unique_ptr<HexagonSubtarget>> SubtargetMap;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000029
30public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000031 HexagonTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Craig Topperb5454082012-03-17 09:24:09 +000032 StringRef FS, const TargetOptions &Options,
Rafael Espindola79e238a2017-08-03 02:16:21 +000033 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
34 CodeGenOpt::Level OL, bool JIT);
Reid Kleckner357600e2014-11-20 23:37:18 +000035 ~HexagonTargetMachine() override;
Krzysztof Parzyszek73e66f32015-08-05 18:35:37 +000036 const HexagonSubtarget *getSubtargetImpl(const Function &F) const override;
37
Tony Linthicum1213a7a2011-12-12 21:14:40 +000038 static unsigned getModuleMatchQuality(const Module &M);
39
Krzysztof Parzyszekc8b94382017-01-26 21:41:10 +000040 void adjustPassManager(PassManagerBuilder &PMB) override;
Craig Topper906c2cd2014-04-29 07:58:16 +000041 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Krzysztof Parzyszek73e66f32015-08-05 18:35:37 +000042 TargetIRAnalysis getTargetIRAnalysis() override;
Aditya Nandakumara2719322014-11-13 09:26:31 +000043
Krzysztof Parzyszek21dc8bd2015-12-18 20:19:30 +000044 HexagonTargetObjectFile *getObjFileLowering() const override {
45 return static_cast<HexagonTargetObjectFile*>(TLOF.get());
Aditya Nandakumara2719322014-11-13 09:26:31 +000046 }
Tony Linthicum1213a7a2011-12-12 21:14:40 +000047};
48
Tony Linthicum1213a7a2011-12-12 21:14:40 +000049} // end namespace llvm
50
51#endif