Move out of line
[llvm-project.git] / llvm / lib / Target / ARC / ARCTargetMachine.h
blob0fc4243ab44a72ce6796df236fac2570fa68dd22
1 //===- ARCTargetMachine.h - Define TargetMachine for ARC --------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the ARC specific subclass of TargetMachine.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H
14 #define LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H
16 #include "ARCSubtarget.h"
17 #include "llvm/Target/TargetMachine.h"
18 #include <optional>
20 namespace llvm {
22 class TargetPassConfig;
24 class ARCTargetMachine : public LLVMTargetMachine {
25 std::unique_ptr<TargetLoweringObjectFile> TLOF;
26 ARCSubtarget Subtarget;
28 public:
29 ARCTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
30 StringRef FS, const TargetOptions &Options,
31 std::optional<Reloc::Model> RM,
32 std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,
33 bool JIT);
34 ~ARCTargetMachine() override;
36 const ARCSubtarget *getSubtargetImpl() const { return &Subtarget; }
37 const ARCSubtarget *getSubtargetImpl(const Function &) const override {
38 return &Subtarget;
41 // Pass Pipeline Configuration
42 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
44 TargetTransformInfo getTargetTransformInfo(const Function &F) const override;
45 TargetLoweringObjectFile *getObjFileLowering() const override {
46 return TLOF.get();
49 MachineFunctionInfo *
50 createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F,
51 const TargetSubtargetInfo *STI) const override;
54 } // end namespace llvm
56 #endif // LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H