Path: blob/main/contrib/llvm-project/llvm/lib/Target/BPF/BPFCORE.h
35269 views
//===- BPFCORE.h - Common info for Compile-Once Run-EveryWhere -*- 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//===----------------------------------------------------------------------===//78#ifndef LLVM_LIB_TARGET_BPF_BPFCORE_H9#define LLVM_LIB_TARGET_BPF_BPFCORE_H1011#include "llvm/ADT/StringRef.h"12#include "llvm/IR/Instructions.h"1314namespace llvm {1516class BasicBlock;17class Instruction;18class Module;1920class BPFCoreSharedInfo {21public:22enum BTFTypeIdFlag : uint32_t {23BTF_TYPE_ID_LOCAL_RELOC = 0,24BTF_TYPE_ID_REMOTE_RELOC,2526MAX_BTF_TYPE_ID_FLAG,27};2829enum PreserveTypeInfo : uint32_t {30PRESERVE_TYPE_INFO_EXISTENCE = 0,31PRESERVE_TYPE_INFO_SIZE,32PRESERVE_TYPE_INFO_MATCH,3334MAX_PRESERVE_TYPE_INFO_FLAG,35};3637enum PreserveEnumValue : uint32_t {38PRESERVE_ENUM_VALUE_EXISTENCE = 0,39PRESERVE_ENUM_VALUE,4041MAX_PRESERVE_ENUM_VALUE_FLAG,42};4344/// The attribute attached to globals representing a field access45static constexpr StringRef AmaAttr = "btf_ama";46/// The attribute attached to globals representing a type id47static constexpr StringRef TypeIdAttr = "btf_type_id";4849/// llvm.bpf.passthrough builtin seq number50static uint32_t SeqNum;5152/// Insert a bpf passthrough builtin function.53static Instruction *insertPassThrough(Module *M, BasicBlock *BB,54Instruction *Input,55Instruction *Before);56static void removeArrayAccessCall(CallInst *Call);57static void removeStructAccessCall(CallInst *Call);58static void removeUnionAccessCall(CallInst *Call);59};6061} // namespace llvm6263#endif646566