Pete Couperus | 2d1f6d6 | 2017-08-24 15:40:33 +0000 | [diff] [blame] | 1 | //===- ARCTargetMachine.h - Define TargetMachine for ARC --------*- 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 ARC specific subclass of TargetMachine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H |
| 15 | #define LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H |
| 16 | |
| 17 | #include "ARCSubtarget.h" |
| 18 | #include "llvm/Target/TargetMachine.h" |
| 19 | |
| 20 | namespace llvm { |
| 21 | |
| 22 | class TargetPassConfig; |
| 23 | |
Matthias Braun | bb8507e | 2017-10-12 22:57:28 +0000 | [diff] [blame] | 24 | class ARCTargetMachine : public LLVMTargetMachine { |
Pete Couperus | 2d1f6d6 | 2017-08-24 15:40:33 +0000 | [diff] [blame] | 25 | std::unique_ptr<TargetLoweringObjectFile> TLOF; |
| 26 | ARCSubtarget Subtarget; |
| 27 | |
| 28 | public: |
| 29 | ARCTargetMachine(const Target &T, const Triple &TT, StringRef CPU, |
| 30 | StringRef FS, const TargetOptions &Options, |
| 31 | Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM, |
| 32 | CodeGenOpt::Level OL, bool JIT); |
| 33 | ~ARCTargetMachine() override; |
| 34 | |
| 35 | const ARCSubtarget *getSubtargetImpl() const { return &Subtarget; } |
| 36 | const ARCSubtarget *getSubtargetImpl(const Function &) const override { |
| 37 | return &Subtarget; |
| 38 | } |
| 39 | |
| 40 | // Pass Pipeline Configuration |
| 41 | TargetPassConfig *createPassConfig(PassManagerBase &PM) override; |
| 42 | |
Sanjoy Das | 26d11ca | 2017-12-22 18:21:59 +0000 | [diff] [blame^] | 43 | TargetTransformInfo getTargetTransformInfo(const Function &F) override; |
Pete Couperus | 2d1f6d6 | 2017-08-24 15:40:33 +0000 | [diff] [blame] | 44 | TargetLoweringObjectFile *getObjFileLowering() const override { |
| 45 | return TLOF.get(); |
| 46 | } |
| 47 | }; |
| 48 | |
| 49 | } // end namespace llvm |
| 50 | |
| 51 | #endif // LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H |