[Mesa-dev] [PATCH 56/56] glsl: Replace most assertions with unreachable()
Ian Romanick
idr at freedesktop.org
Tue Jul 19 19:25:15 UTC 2016
From: Ian Romanick <ian.d.romanick at intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/compiler/glsl/ir_expression_operation.py | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/compiler/glsl/ir_expression_operation.py b/src/compiler/glsl/ir_expression_operation.py
index bac5a12..c466c08 100644
--- a/src/compiler/glsl/ir_expression_operation.py
+++ b/src/compiler/glsl/ir_expression_operation.py
@@ -103,7 +103,7 @@ constant_template_common = mako.template.Template("""\
break;
% endfor
default:
- assert(0);
+ unreachable("invalid type");
}
}
break;""")
@@ -134,7 +134,7 @@ constant_template_vector_scalar = mako.template.Template("""\
break;
% endfor
default:
- assert(0);
+ unreachable("invalid type");
}
}
break;""")
@@ -157,7 +157,7 @@ constant_template_mul = mako.template.Template("""\
break;
% endfor
default:
- assert(0);
+ unreachable("invalid type");
}
}
} else {
@@ -215,7 +215,7 @@ constant_template_horizontal = mako.template.Template("""\
break;
% endfor
default:
- assert(0);
+ unreachable("invalid type");
}
break;""")
@@ -232,7 +232,7 @@ constant_template_vector_extract = mako.template.Template("""\
break;
% endfor
default:
- assert(0);
+ unreachable("invalid type");
}
break;
}""")
@@ -251,8 +251,7 @@ constant_template_vector_insert = mako.template.Template("""\
break;
% endfor
default:
- assert(!"Should not get here.");
- break;
+ unreachable("invalid type");
}
break;
}""")
@@ -268,7 +267,7 @@ constant_template_vector = mako.template.Template("""\
break;
% endfor
default:
- assert(0);
+ unreachable("invalid type");
}
}
break;""")
@@ -292,7 +291,7 @@ constant_template_lrp = mako.template.Template("""\
break;
% endfor
default:
- assert(0);
+ unreachable("invalid type");
}
}
break;
@@ -311,7 +310,7 @@ constant_template_csel = mako.template.Template("""\
break;
% endfor
default:
- assert(0);
+ unreachable("invalid type");
}
}
break;""")
--
2.5.5
More information about the mesa-dev
mailing list