summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-12-06 14:18:21 -0800
committerMatt Turner <[email protected]>2014-12-08 08:50:26 -0800
commitf65200ccc9115cec9da780d8cdd119e934fdc664 (patch)
tree98d7f9d21ec7d2733afcfa5a78834d49c21f039b /src/mesa
parentb6a71cbb644ac53112f08955a43b2a974279e1e1 (diff)
i965: Remove default from brw_instruction_name switch to catch missing names.
The case-range extension is available in clang and gcc at least back to 3.4.0. Signed-off-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index c0ca26b17e6..56aa7578603 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -380,12 +380,10 @@ brw_texture_offset(struct gl_context *ctx, int *offsets,
const char *
brw_instruction_name(enum opcode op)
{
- char *fallback;
-
- if (op < ARRAY_SIZE(opcode_descs) && opcode_descs[op].name)
- return opcode_descs[op].name;
-
switch (op) {
+ case BRW_OPCODE_MOV ... BRW_OPCODE_NOP:
+ assert(opcode_descs[op].name);
+ return opcode_descs[op].name;
case FS_OPCODE_FB_WRITE:
return "fb_write";
case FS_OPCODE_BLORP_FB_WRITE:
@@ -557,14 +555,9 @@ brw_instruction_name(enum opcode op)
return "gs_svb_set_dst_index";
case GS_OPCODE_FF_SYNC_SET_PRIMITIVES:
return "gs_ff_sync_set_primitives";
-
- default:
- /* Yes, this leaks. It's in debug code, it should never occur, and if
- * it does, you should just add the case to the list above.
- */
- asprintf(&fallback, "op%d", op);
- return fallback;
}
+
+ unreachable("not reached");
}
backend_visitor::backend_visitor(struct brw_context *brw,