[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / lib / Target / RISCV / RISCVTargetMachine.h
blob3156333f7ee1750ca950bdc4246d449db353e5d3
1 //===-- RISCVTargetMachine.h - Define TargetMachine for RISCV ---*- 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 RISCV specific subclass of TargetMachine.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_RISCV_RISCVTARGETMACHINE_H
14 #define LLVM_LIB_TARGET_RISCV_RISCVTARGETMACHINE_H
16 #include "MCTargetDesc/RISCVMCTargetDesc.h"
17 #include "RISCVSubtarget.h"
18 #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Target/TargetMachine.h"
22 namespace llvm {
23 class RISCVTargetMachine : public LLVMTargetMachine {
24 std::unique_ptr<TargetLoweringObjectFile> TLOF;
25 mutable StringMap<std::unique_ptr<RISCVSubtarget>> SubtargetMap;
27 public:
28 RISCVTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
29 StringRef FS, const TargetOptions &Options,
30 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
31 CodeGenOpt::Level OL, bool JIT);
33 const RISCVSubtarget *getSubtargetImpl(const Function &F) const override;
34 // DO NOT IMPLEMENT: There is no such thing as a valid default subtarget,
35 // subtargets are per-function entities based on the target-specific
36 // attributes of each function.
37 const RISCVSubtarget *getSubtargetImpl() const = delete;
39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
41 TargetLoweringObjectFile *getObjFileLowering() const override {
42 return TLOF.get();
45 TargetTransformInfo getTargetTransformInfo(const Function &F) override;
47 virtual bool isNoopAddrSpaceCast(unsigned SrcAS,
48 unsigned DstAS) const override;
50 } // namespace llvm
52 #endif