19#ifndef BF_P4C_LIB_SAFE_WIDTH_H_
20#define BF_P4C_LIB_SAFE_WIDTH_H_
25inline int safe_width_bits(
const IR::Type *type) {
27 if (!type->is<IR::Type_Enum>() && !type->is<IR::Type_Error>() &&
28 !type->is<IR::Type_Unknown>() && !type->is<IR::Type_Dontcare>())
29 width = type->width_bits();
34inline int safe_width_bits(
const IR::Expression *e) {
return safe_width_bits(e->type); }