Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 1 | //=-- 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 Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETMACHINE_H |
| 15 | #define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETMACHINE_H |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 16 | |
Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 17 | #include "HexagonInstrInfo.h" |
Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 18 | #include "HexagonSubtarget.h" |
Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 19 | #include "llvm/Target/TargetMachine.h" |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 20 | |
| 21 | namespace llvm { |
| 22 | |
| 23 | class Module; |
| 24 | |
| 25 | class HexagonTargetMachine : public LLVMTargetMachine { |
Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 26 | std::unique_ptr<TargetLoweringObjectFile> TLOF; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 27 | HexagonSubtarget Subtarget; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 28 | |
| 29 | public: |
| 30 | HexagonTargetMachine(const Target &T, StringRef TT,StringRef CPU, |
Craig Topper | b545408 | 2012-03-17 09:24:09 +0000 | [diff] [blame] | 31 | StringRef FS, const TargetOptions &Options, |
| 32 | Reloc::Model RM, CodeModel::Model CM, |
| 33 | CodeGenOpt::Level OL); |
Reid Kleckner | 357600e | 2014-11-20 23:37:18 +0000 | [diff] [blame^] | 34 | ~HexagonTargetMachine() override; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 35 | |
Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 36 | const HexagonSubtarget *getSubtargetImpl() const override { |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 37 | return &Subtarget; |
| 38 | } |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 39 | static unsigned getModuleMatchQuality(const Module &M); |
| 40 | |
Craig Topper | 906c2cd | 2014-04-29 07:58:16 +0000 | [diff] [blame] | 41 | TargetPassConfig *createPassConfig(PassManagerBase &PM) override; |
Aditya Nandakumar | a271932 | 2014-11-13 09:26:31 +0000 | [diff] [blame] | 42 | |
| 43 | TargetLoweringObjectFile *getObjFileLowering() const override { |
| 44 | return TLOF.get(); |
| 45 | } |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | extern bool flag_aligned_memcpy; |
| 49 | |
| 50 | } // end namespace llvm |
| 51 | |
| 52 | #endif |