1 //===-- M68kTargetMachine.h - Define TargetMachine for M68k -----*- 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 /// \file
10 /// This file declares the M68k specific subclass of TargetMachine.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_M68K_M68KTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_M68K_M68KTARGETMACHINE_H
16 
17 #include "M68kSubtarget.h"
18 #include "MCTargetDesc/M68kMCTargetDesc.h"
19 
20 #include "llvm/CodeGen/Passes.h"
21 #include "llvm/CodeGen/SelectionDAGISel.h"
22 #include "llvm/CodeGen/TargetFrameLowering.h"
23 #include "llvm/Target/TargetMachine.h"
24 
25 namespace llvm {
26 class formatted_raw_ostream;
27 class M68kRegisterInfo;
28 
29 class M68kTargetMachine : public LLVMTargetMachine {
30   std::unique_ptr<TargetLoweringObjectFile> TLOF;
31   M68kSubtarget Subtarget;
32 
33   mutable StringMap<std::unique_ptr<M68kSubtarget>> SubtargetMap;
34 
35 public:
36   M68kTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
37                     StringRef FS, const TargetOptions &Options,
38                     Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
39                     CodeGenOpt::Level OL, bool JIT);
40 
41   ~M68kTargetMachine() override;
42 
43   const M68kSubtarget *getSubtargetImpl() const { return &Subtarget; }
44 
45   const M68kSubtarget *getSubtargetImpl(const Function &F) const override;
46 
47   // Pass Pipeline Configuration
48   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
49 
50   TargetLoweringObjectFile *getObjFileLowering() const override {
51     return TLOF.get();
52   }
53 };
54 } // namespace llvm
55 
56 #endif // LLVM_LIB_TARGET_M68K_M68KTARGETMACHINE_H
57