To aid in debugging.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
case WRITEMASK_Z: return SWIZZLE_Z;
case WRITEMASK_W: return SWIZZLE_W;
}
- assert(!"not reached");
- unreachable();
+ unreachable("not reached");
}
/**
coord = coords3;
break;
default:
- assert(0);
- unreachable();
+ unreachable("not reached");
}
coord[3] = (float) (slice / 6);
x_scaledown = 2;
break;
default:
- assert(!"Unexpected sample count for fast clear");
- unreachable();
- break;
+ unreachable("Unexpected sample count for fast clear");
}
y_scaledown = 2;
x_align = x_scaledown * 2;
case 16:
return brw_vec16_reg(file, nr, subnr);
default:
- assert(!"Invalid register width");
+ unreachable("Invalid register width");
}
- unreachable();
}
static inline struct brw_reg
virtual vec4_instruction *emit_urb_write_opcode(bool complete)
{
- assert(!"Not reached");
- unreachable();
+ unreachable("Not reached");
}
};
virtual vec4_instruction *emit_urb_write_opcode(bool complete)
{
- assert(!"Not reached");
- unreachable();
+ unreachable("Not reached");
}
};
* function" warnings.
*/
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 5
-#define unreachable() __builtin_unreachable()
+#define unreachable(str) \
+do { \
+ assert(!str); \
+ __builtin_unreachable(); \
+} while (0)
#elif (defined(__clang__) && defined(__has_builtin))
# if __has_builtin(__builtin_unreachable)
-# define unreachable() __builtin_unreachable()
+# define unreachable(str) \
+do { \
+ assert(!str); \
+ __builtin_unreachable(); \
+} while (0)
# endif
#endif
#ifndef unreachable
-#define unreachable()
+#define unreachable(str)
#endif
/*