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]]
44void end_fatal_error();
47template <
typename... T>
48inline void fatal_error(
const char *format, T... args) {
49 error(format, args...);
54template <
typename... T>
55inline void fatal_error(
int kind,
const char *format, T... args) {
56 error(kind, format, args...);
60#ifdef BAREFOOT_INTERNAL
61#define INTERNAL_WARNING(...) warning(ErrorType::WARN_UNSUPPORTED, __VA_ARGS__)
63#define INTERNAL_WARNING(...) BUG(__VA_ARGS__)
68bool ghost_only_on_other_pipes(
int pipe_id);
72std::pair<cstring, cstring> get_key_and_mask(
const cstring &input);
76std::tuple<bool, cstring, int, int> get_key_slice_info(
const cstring &input);
80bool is_starter_pistol_table(
const cstring &tableName);
Definition ir/vector.h:59
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:58