blob: 18117e3409af325590688905808a39ab596ff9da [file] [log] [blame]
Pete Couperus2d1f6d62017-08-24 15:40:33 +00001//===- 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
20namespace llvm {
21
22class TargetPassConfig;
23
Matthias Braunbb8507e2017-10-12 22:57:28 +000024class ARCTargetMachine : public LLVMTargetMachine {
Pete Couperus2d1f6d62017-08-24 15:40:33 +000025 std::unique_ptr<TargetLoweringObjectFile> TLOF;
26 ARCSubtarget Subtarget;
27
28public:
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 Das26d11ca2017-12-22 18:21:59 +000043 TargetTransformInfo getTargetTransformInfo(const Function &F) override;
Pete Couperus2d1f6d62017-08-24 15:40:33 +000044 TargetLoweringObjectFile *getObjFileLowering() const override {
45 return TLOF.get();
46 }
47};
48
49} // end namespace llvm
50
51#endif // LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H