P4C
The P4 Compiler
Loading...
Searching...
No Matches
tofino/bf-p4c/arch/helpers.h
1
19#ifndef BF_P4C_ARCH_HELPERS_H_
20#define BF_P4C_ARCH_HELPERS_H_
21
22#include <optional>
23
24#include "frontends/common/resolveReferences/referenceMap.h"
25#include "frontends/p4/externInstance.h"
26#include "frontends/p4/methodInstance.h"
27#include "frontends/p4/typeMap.h"
28#include "ir/ir.h"
29
30namespace BFN {
31
32const IR::Declaration_Instance *getDeclInst(const P4::ReferenceMap *refMap,
33 const IR::PathExpression *path);
34
35std::optional<cstring> getExternTypeName(const P4::ExternMethod *extMethod);
36
37std::optional<P4::ExternInstance> getExternInstanceFromPropertyByTypeName(
38 const IR::P4Table *table, cstring propertyName, cstring typeName, P4::ReferenceMap *refMap,
39 P4::TypeMap *typeMap, bool *isConstructedInPlace = nullptr);
40
43std::optional<P4::ExternInstance> getExternInstanceFromProperty(const IR::P4Table *table,
44 cstring propertyName,
45 P4::ReferenceMap *refMap,
46 P4::TypeMap *typeMap);
47
48std::optional<const IR::ExpressionValue *> getExpressionFromProperty(const IR::P4Table *table,
49 const cstring &propertyName);
50
51std::vector<const IR::Expression *> convertConcatToList(const IR::Concat *expr);
52
53} // namespace BFN
54
55#endif /* BF_P4C_ARCH_HELPERS_H_ */
Definition methodInstance.h:168
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition typeMap.h:41
The namespace encapsulating Barefoot/Intel-specific stuff.
Definition add_t2na_meta.cpp:21
std::optional< P4::ExternInstance > getExternInstanceFromPropertyByTypeName(const IR::P4Table *table, cstring propertyName, cstring externTypeName, P4::ReferenceMap *refMap, P4::TypeMap *typeMap, bool *isConstructedInPlace)
Definition tofino/bf-p4c/arch/helpers.cpp:60
const IR::Declaration_Instance * getDeclInst(const P4::ReferenceMap *refMap, const IR::PathExpression *path)
Definition tofino/bf-p4c/arch/helpers.cpp:29
std::optional< P4::ExternInstance > getExternInstanceFromProperty(const IR::P4Table *table, cstring propertyName, P4::ReferenceMap *refMap, P4::TypeMap *typeMap)
Definition tofino/bf-p4c/arch/helpers.cpp:122