xref: /freebsd/contrib/llvm-project/llvm/lib/Target/M68k/M68kTargetMachine.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
104eeddc0SDimitry Andric //===-- M68kTargetMachine.h - Define TargetMachine for M68k -----*- C++ -*-===//
2fe6060f1SDimitry Andric //
3fe6060f1SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4fe6060f1SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5fe6060f1SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6fe6060f1SDimitry Andric //
7fe6060f1SDimitry Andric //===----------------------------------------------------------------------===//
8fe6060f1SDimitry Andric ///
9fe6060f1SDimitry Andric /// \file
10fe6060f1SDimitry Andric /// This file declares the M68k specific subclass of TargetMachine.
11fe6060f1SDimitry Andric ///
12fe6060f1SDimitry Andric //===----------------------------------------------------------------------===//
13fe6060f1SDimitry Andric 
14fe6060f1SDimitry Andric #ifndef LLVM_LIB_TARGET_M68K_M68KTARGETMACHINE_H
15fe6060f1SDimitry Andric #define LLVM_LIB_TARGET_M68K_M68KTARGETMACHINE_H
16fe6060f1SDimitry Andric 
17fe6060f1SDimitry Andric #include "M68kSubtarget.h"
18fe6060f1SDimitry Andric #include "MCTargetDesc/M68kMCTargetDesc.h"
19fe6060f1SDimitry Andric 
20fe6060f1SDimitry Andric #include "llvm/CodeGen/Passes.h"
21fe6060f1SDimitry Andric #include "llvm/CodeGen/SelectionDAGISel.h"
22fe6060f1SDimitry Andric #include "llvm/CodeGen/TargetFrameLowering.h"
23fe6060f1SDimitry Andric #include "llvm/Target/TargetMachine.h"
24fe6060f1SDimitry Andric 
25bdd1243dSDimitry Andric #include <optional>
26bdd1243dSDimitry Andric 
27fe6060f1SDimitry Andric namespace llvm {
28fe6060f1SDimitry Andric class formatted_raw_ostream;
29fe6060f1SDimitry Andric class M68kRegisterInfo;
30fe6060f1SDimitry Andric 
31fe6060f1SDimitry Andric class M68kTargetMachine : public LLVMTargetMachine {
32fe6060f1SDimitry Andric   std::unique_ptr<TargetLoweringObjectFile> TLOF;
33fe6060f1SDimitry Andric   M68kSubtarget Subtarget;
34fe6060f1SDimitry Andric 
35fe6060f1SDimitry Andric   mutable StringMap<std::unique_ptr<M68kSubtarget>> SubtargetMap;
36fe6060f1SDimitry Andric 
37fe6060f1SDimitry Andric public:
38fe6060f1SDimitry Andric   M68kTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
39fe6060f1SDimitry Andric                     StringRef FS, const TargetOptions &Options,
40bdd1243dSDimitry Andric                     std::optional<Reloc::Model> RM,
41*5f757f3fSDimitry Andric                     std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,
42bdd1243dSDimitry Andric                     bool JIT);
43fe6060f1SDimitry Andric 
44fe6060f1SDimitry Andric   ~M68kTargetMachine() override;
45fe6060f1SDimitry Andric 
46fe6060f1SDimitry Andric   const M68kSubtarget *getSubtargetImpl() const { return &Subtarget; }
47fe6060f1SDimitry Andric 
48fe6060f1SDimitry Andric   const M68kSubtarget *getSubtargetImpl(const Function &F) const override;
49fe6060f1SDimitry Andric 
50bdd1243dSDimitry Andric   MachineFunctionInfo *
51bdd1243dSDimitry Andric   createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F,
52bdd1243dSDimitry Andric                             const TargetSubtargetInfo *STI) const override;
53bdd1243dSDimitry Andric 
54fe6060f1SDimitry Andric   // Pass Pipeline Configuration
55fe6060f1SDimitry Andric   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
56fe6060f1SDimitry Andric 
57fe6060f1SDimitry Andric   TargetLoweringObjectFile *getObjFileLowering() const override {
58fe6060f1SDimitry Andric     return TLOF.get();
59fe6060f1SDimitry Andric   }
60fe6060f1SDimitry Andric };
61fe6060f1SDimitry Andric } // namespace llvm
62fe6060f1SDimitry Andric 
6304eeddc0SDimitry Andric #endif // LLVM_LIB_TARGET_M68K_M68KTARGETMACHINE_H
64