xref: /freebsd/contrib/llvm-project/llvm/lib/Target/BPF/BPFPassRegistry.def (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1//===- BPFPassRegistry.def - Registry of BPF passes -------------*- 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 is used as the registry of passes that are part of the
10// BPF backend.
11//
12//===----------------------------------------------------------------------===//
13
14// NOTE: NO INCLUDE GUARD DESIRED!
15
16#ifndef FUNCTION_PASS
17#define FUNCTION_PASS(NAME, CREATE_PASS)
18#endif
19FUNCTION_PASS("bpf-aspace-simplify", BPFASpaceCastSimplifyPass())
20FUNCTION_PASS("bpf-ir-peephole", BPFIRPeepholePass())
21#undef FUNCTION_PASS
22
23#ifndef FUNCTION_PASS_WITH_PARAMS
24#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS, CREATE_PASS, PARSER, PARAMS)
25#endif
26FUNCTION_PASS_WITH_PARAMS(
27    "bpf-preserve-static-offset", "BPFPreserveStaticOffsetPass",
28    [=](bool AllowPartial) {
29      return BPFPreserveStaticOffsetPass(AllowPartial);
30    },
31    parseBPFPreserveStaticOffsetOptions, "allow-partial")
32#undef FUNCTION_PASS_WITH_PARAMS
33