Path: blob/main/contrib/llvm-project/llvm/lib/Target/BPF/BPFTargetMachine.h
35269 views
//===-- BPFTargetMachine.h - Define TargetMachine for BPF --- 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 BPF specific subclass of TargetMachine.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_BPF_BPFTARGETMACHINE_H13#define LLVM_LIB_TARGET_BPF_BPFTARGETMACHINE_H1415#include "BPFSubtarget.h"16#include "llvm/Target/TargetMachine.h"17#include <optional>1819namespace llvm {20class BPFTargetMachine : public LLVMTargetMachine {21std::unique_ptr<TargetLoweringObjectFile> TLOF;22BPFSubtarget Subtarget;2324public:25BPFTargetMachine(const Target &T, const Triple &TT, StringRef CPU,26StringRef FS, const TargetOptions &Options,27std::optional<Reloc::Model> RM,28std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,29bool JIT);3031const BPFSubtarget *getSubtargetImpl() const { return &Subtarget; }32const BPFSubtarget *getSubtargetImpl(const Function &) const override {33return &Subtarget;34}3536TargetPassConfig *createPassConfig(PassManagerBase &PM) override;3738TargetTransformInfo getTargetTransformInfo(const Function &F) const override;3940TargetLoweringObjectFile *getObjFileLowering() const override {41return TLOF.get();42}4344void registerPassBuilderCallbacks(PassBuilder &PB) override;45};46}4748#endif495051