8#ifndef CONTROL_PLANE_TYPESPECCONVERTER_H_
9#define CONTROL_PLANE_TYPESPECCONVERTER_H_
15#include "ir/visitor.h"
16#pragma GCC diagnostic push
17#pragma GCC diagnostic ignored "-Wunused-parameter"
18#pragma GCC diagnostic ignored "-Wpedantic"
19#include "p4/config/v1/p4info.pb.h"
20#pragma GCC diagnostic pop
37class TypeSpecConverter :
public Inspector {
43 ::p4::config::v1::P4TypeInfo *p4RtTypeInfo;
46 std::map<const IR::Type *, ::p4::config::v1::P4DataTypeSpec *> map;
49 ::p4::config::v1::P4TypeInfo *p4RtTypeInfo);
52 bool preorder(
const IR::Type *type)
override;
55 bool preorder(
const IR::Type_Bits *type)
override;
56 bool preorder(
const IR::Type_Varbits *type)
override;
57 bool preorder(
const IR::Type_Boolean *type)
override;
58 bool preorder(
const IR::Type_BaseList *type)
override;
59 bool preorder(
const IR::Type_Array *type)
override;
61 bool preorder(
const IR::Type_Name *type)
override;
62 bool preorder(
const IR::Type_Newtype *type)
override;
66 bool preorder(
const IR::Type_Struct *type)
override;
67 bool preorder(
const IR::Type_Header *type)
override;
68 bool preorder(
const IR::Type_HeaderUnion *type)
override;
69 bool preorder(
const IR::Type_Enum *type)
override;
70 bool preorder(
const IR::Type_SerEnum *type)
override;
71 bool preorder(
const IR::Type_Error *type)
override;
80 ::p4::config::v1::P4TypeInfo *typeInfo);
85 enum Type { kBit, kString };
92 std::string original_type_uri;
static const ::p4::config::v1::P4DataTypeSpec * convert(const P4::ReferenceMap *refMap, P4::TypeMap *typeMap, const IR::Type *type, ::p4::config::v1::P4TypeInfo *typeInfo)
Definition typeSpecConverter.cpp:377
Class used to encode maps from paths to declarations.
Definition referenceMap.h:67
TODO(antonin): High level goals of the generator go here!!
Definition dpdk/control-plane/bfruntime_arch_handler.h:44
cstring getTypeName(const IR::Type *type, TypeMap *typeMap)
Definition typeSpecConverter.cpp:68
bool hasTranslationAnnotation(const IR::Type *type, TranslationAnnotation *payload)
Definition typeSpecConverter.cpp:32
Payload of @p4runtime_translation annotation.
Definition typeSpecConverter.h:91
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13
See section "User-defined types" in P4RT specification.
Definition typeSpecConverter.h:84