17#ifndef BACKENDS_UBPF_UBPFDEPARSER_H_
18#define BACKENDS_UBPF_UBPFDEPARSER_H_
20#include "backends/ebpf/ebpfObject.h"
22#include "ubpfHelpers.h"
23#include "ubpfProgram.h"
36 virtual void compileEmitField(
const IR::Expression *expr,
cstring field,
unsigned alignment,
40 bool notSupported(
const IR::Expression *expression) {
41 ::P4::error(ErrorType::ERR_UNSUPPORTED_ON_TARGET,
"%1%: not supported in Deparser",
46 bool notSupported(
const IR::StatOrDecl *statOrDecl) {
47 ::P4::error(ErrorType::ERR_UNSUPPORTED_ON_TARGET,
"%1%: not supported in Deparser",
52 bool preorder(
const IR::MethodCallExpression *expression)
override;
53 bool preorder(
const IR::AssignmentStatement *a)
override {
return notSupported(a); };
54 bool preorder(
const IR::ExitStatement *s)
override {
return notSupported(s); };
55 bool preorder(UNUSED
const IR::BlockStatement *s)
override {
return true; };
56 bool preorder(
const IR::ReturnStatement *s)
override {
return notSupported(s); };
57 bool preorder(
const IR::IfStatement *statement)
override {
return notSupported(statement); };
58 bool preorder(
const IR::SwitchStatement *statement)
override {
59 return notSupported(statement);
61 bool preorder(
const IR::Operation_Binary *b)
override {
return notSupported(b); };
67 const IR::ControlBlock *controlBlock;
68 const IR::Parameter *packet_out;
69 const IR::Parameter *headers;
70 const IR::Parameter *parserHeaders;
75 const IR::Parameter *parserHeaders)
76 : program(program), controlBlock(block), headers(
nullptr), parserHeaders(parserHeaders) {}
Definition ebpf/codeGen.h:33
Definition ebpf/codeGen.h:41
Base class for EBPF objects.
Definition ebpfObject.h:31
Base class for EBPF types.
Definition ebpfType.h:29
Definition coreLibrary.h:103
Definition ubpfDeparser.h:64
Definition ubpfDeparser.h:29
Definition ubpfProgram.h:37
void error(const char *format, Args &&...args)
Report an error with the given message.
Definition lib/error.h:51