19#ifndef BACKENDS_TOFINO_BF_P4C_COMMON_IR_UTILS_H_
20#define BACKENDS_TOFINO_BF_P4C_COMMON_IR_UTILS_H_
26IR::Member *gen_fieldref(
const IR::HeaderOrMetadata *hdr,
cstring field);
28const IR::HeaderOrMetadata *getMetadataType(
const IR::BFN::Pipe *pipe,
cstring typeName);
30bool isSigned(
const IR::Type *);
34inline T *clone_update(
const T *&ptr) {
40uint64_t bitMask(
unsigned size);
41big_int bigBitMask(
int size);
46 std::function<void(BT *)> fn;
47 bool backtrack(
trigger &trig)
override {
48 if (
auto t =
dynamic_cast<BT *
>(&trig)) {
56 const IR::Node *apply_visitor(
const IR::Node *n,
const char * = 0)
override {
return n; }
59 explicit CatchBacktrack(std::function<
void(BT *)> f) : fn(f) {}
60 explicit CatchBacktrack(std::function<
void()> f) : fn([f](BT *) { f(); }) {}
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24