[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / llvm / lib / Target / LoongArch / LoongArchTargetMachine.h
blob7d39d47e86b363095802801920ff4ff9e7caed80
1 //=- LoongArchTargetMachine.h - Define TargetMachine for LoongArch -*- 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 LoongArch specific subclass of TargetMachine.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H
14 #define LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H
16 #include "LoongArchSubtarget.h"
17 #include "llvm/Target/TargetMachine.h"
18 #include <optional>
20 namespace llvm {
22 class LoongArchTargetMachine : public LLVMTargetMachine {
23 std::unique_ptr<TargetLoweringObjectFile> TLOF;
24 mutable StringMap<std::unique_ptr<LoongArchSubtarget>> SubtargetMap;
26 public:
27 LoongArchTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
28 StringRef FS, const TargetOptions &Options,
29 std::optional<Reloc::Model> RM,
30 std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,
31 bool JIT);
32 ~LoongArchTargetMachine() override;
34 TargetTransformInfo getTargetTransformInfo(const Function &F) const override;
35 const LoongArchSubtarget *getSubtargetImpl(const Function &F) const override;
36 const LoongArchSubtarget *getSubtargetImpl() const = delete;
38 // Pass Pipeline Configuration
39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
41 TargetLoweringObjectFile *getObjFileLowering() const override {
42 return TLOF.get();
45 MachineFunctionInfo *
46 createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F,
47 const TargetSubtargetInfo *STI) const override;
50 } // end namespace llvm
52 #endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H