blob: 4a9f44732a6bb48542f888cee297de29823bb800 [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"
Chandler Carruth802d7552012-12-04 07:12:27 +000019#include "llvm/Target/TargetMachine.h"
Tony Linthicum1213a7a2011-12-12 21:14:40 +000020
21namespace llvm {
22
23class Module;
24
25class HexagonTargetMachine : public LLVMTargetMachine {
Aditya Nandakumara2719322014-11-13 09:26:31 +000026 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000027 HexagonSubtarget Subtarget;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000028
29public:
30 HexagonTargetMachine(const Target &T, StringRef TT,StringRef CPU,
Craig Topperb5454082012-03-17 09:24:09 +000031 StringRef FS, const TargetOptions &Options,
32 Reloc::Model RM, CodeModel::Model CM,
33 CodeGenOpt::Level OL);
Reid Kleckner357600e2014-11-20 23:37:18 +000034 ~HexagonTargetMachine() override;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000035
Craig Topper906c2cd2014-04-29 07:58:16 +000036 const HexagonSubtarget *getSubtargetImpl() const override {
Tony Linthicum1213a7a2011-12-12 21:14:40 +000037 return &Subtarget;
38 }
Tony Linthicum1213a7a2011-12-12 21:14:40 +000039 static unsigned getModuleMatchQuality(const Module &M);
40
Craig Topper906c2cd2014-04-29 07:58:16 +000041 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Aditya Nandakumara2719322014-11-13 09:26:31 +000042
43 TargetLoweringObjectFile *getObjFileLowering() const override {
44 return TLOF.get();
45 }
Tony Linthicum1213a7a2011-12-12 21:14:40 +000046};
47
48extern bool flag_aligned_memcpy;
49
50} // end namespace llvm
51
52#endif