19#ifndef BACKENDS_TOFINO_BF_P4C_COMMON_UTILS_H_
20#define BACKENDS_TOFINO_BF_P4C_COMMON_UTILS_H_
25#include "lib/error_catalog.h"
26#include "lib/exceptions.h"
29#if defined(__GNUC__) && __GNUC__ < 7
30#define BFN_FALLTHROUGH
31#define BFN_MAYBE_UNUSED __attribute__((unused))
33#define BFN_FALLTHROUGH [[fallthrough]]
34#define BFN_MAYBE_UNUSED [[maybe_unused]]
42 explicit DumpPipe(
const char *h) : heading(h) {}
44 bool preorder(
const IR::Node *pipe)
override;
53void end_fatal_error();
56template <
typename... T>
57inline void fatal_error(
const char *format, T... args) {
58 error(format, args...);
63template <
typename... T>
64inline void fatal_error(
int kind,
const char *format, T... args) {
65 error(kind, format, args...);
69#ifdef BAREFOOT_INTERNAL
70#define INTERNAL_WARNING(...) warning(ErrorType::WARN_UNSUPPORTED, __VA_ARGS__)
72#define INTERNAL_WARNING(...) BUG(__VA_ARGS__)
77bool ghost_only_on_other_pipes(
int pipe_id);
81std::pair<cstring, cstring> get_key_and_mask(
const cstring &input);
85std::tuple<bool, cstring, int, int> get_key_slice_info(
const cstring &input);
89bool is_starter_pistol_table(
const cstring &tableName);
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
void error(const char *format, Args &&...args)
Report an error with the given message.
Definition lib/error.h:51
Definition common/utils.h:39