Path: blob/main/contrib/llvm-project/llvm/lib/Target/CSKY/CSKYTargetMachine.h
35269 views
//===--- CSKYTargetMachine.h - Define TargetMachine for CSKY ----*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file declares the CSKY specific subclass of TargetMachine.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_CSKY_CSKYTARGETMACHINE_H13#define LLVM_LIB_TARGET_CSKY_CSKYTARGETMACHINE_H1415#include "CSKYSubtarget.h"16#include "llvm/IR/DataLayout.h"17#include "llvm/Target/TargetMachine.h"18#include <optional>1920namespace llvm {2122class CSKYTargetMachine : public LLVMTargetMachine {23std::unique_ptr<TargetLoweringObjectFile> TLOF;24mutable StringMap<std::unique_ptr<CSKYSubtarget>> SubtargetMap;2526public:27CSKYTargetMachine(const Target &T, const Triple &TT, StringRef CPU,28StringRef FS, const TargetOptions &Options,29std::optional<Reloc::Model> RM,30std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,31bool JIT);3233TargetPassConfig *createPassConfig(PassManagerBase &PM) override;3435const CSKYSubtarget *getSubtargetImpl(const Function &F) const override;36// DO NOT IMPLEMENT: There is no such thing as a valid default subtarget,37// subtargets are per-function entities based on the target-specific38// attributes of each function.39const CSKYSubtarget *getSubtargetImpl() const = delete;4041TargetLoweringObjectFile *getObjFileLowering() const override {42return TLOF.get();43}4445MachineFunctionInfo *46createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F,47const TargetSubtargetInfo *STI) const override;48};49} // namespace llvm5051#endif525354