aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/BPF/BPFCORE.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-02-16 20:13:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-02-16 20:13:02 +0000
commitb60736ec1405bb0a8dd40989f67ef4c93da068ab (patch)
tree5c43fbb7c9fc45f0f87e0e6795a86267dbd12f9d /llvm/lib/Target/BPF/BPFCORE.h
parentcfca06d7963fa0909f90483b42a6d7d194d01e08 (diff)
Diffstat (limited to 'llvm/lib/Target/BPF/BPFCORE.h')
-rw-r--r--llvm/lib/Target/BPF/BPFCORE.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/Target/BPF/BPFCORE.h b/llvm/lib/Target/BPF/BPFCORE.h
index af6425b16fa0..0c504412480d 100644
--- a/llvm/lib/Target/BPF/BPFCORE.h
+++ b/llvm/lib/Target/BPF/BPFCORE.h
@@ -13,6 +13,10 @@
namespace llvm {
+class BasicBlock;
+class Instruction;
+class Module;
+
class BPFCoreSharedInfo {
public:
enum PatchableRelocKind : uint32_t {
@@ -24,6 +28,10 @@ public:
FIELD_RSHIFT_U64,
BTF_TYPE_ID_LOCAL,
BTF_TYPE_ID_REMOTE,
+ TYPE_EXISTENCE,
+ TYPE_SIZE,
+ ENUM_VALUE_EXISTENCE,
+ ENUM_VALUE,
MAX_FIELD_RELOC_KIND,
};
@@ -35,10 +43,32 @@ public:
MAX_BTF_TYPE_ID_FLAG,
};
+ enum PreserveTypeInfo : uint32_t {
+ PRESERVE_TYPE_INFO_EXISTENCE = 0,
+ PRESERVE_TYPE_INFO_SIZE,
+
+ MAX_PRESERVE_TYPE_INFO_FLAG,
+ };
+
+ enum PreserveEnumValue : uint32_t {
+ PRESERVE_ENUM_VALUE_EXISTENCE = 0,
+ PRESERVE_ENUM_VALUE,
+
+ MAX_PRESERVE_ENUM_VALUE_FLAG,
+ };
+
/// The attribute attached to globals representing a field access
static constexpr StringRef AmaAttr = "btf_ama";
/// The attribute attached to globals representing a type id
static constexpr StringRef TypeIdAttr = "btf_type_id";
+
+ /// llvm.bpf.passthrough builtin seq number
+ static uint32_t SeqNum;
+
+ /// Insert a bpf passthrough builtin function.
+ static Instruction *insertPassThrough(Module *M, BasicBlock *BB,
+ Instruction *Input,
+ Instruction *Before);
};
} // namespace llvm