glsl: replace some asserts with unreachable when processing the ast
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 10 Apr 2018 04:34:26 +0000 (14:34 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 27 Apr 2018 00:18:47 +0000 (10:18 +1000)
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/glsl/ast_to_hir.cpp

index 94ce3c4..3bf5815 100644 (file)
@@ -1397,8 +1397,7 @@ ast_expression::do_hir(exec_list *instructions,
 
    switch (this->oper) {
    case ast_aggregate:
-      assert(!"ast_aggregate: Should never get here.");
-      break;
+      unreachable("ast_aggregate: Should never get here.");
 
    case ast_assign: {
       this->subexpressions[0]->set_is_lhs(true);
@@ -1974,15 +1973,13 @@ ast_expression::do_hir(exec_list *instructions,
    }
 
    case ast_unsized_array_dim:
-      assert(!"ast_unsized_array_dim: Should never get here.");
-      break;
+      unreachable("ast_unsized_array_dim: Should never get here.");
 
    case ast_function_call:
       /* Should *NEVER* get here.  ast_function_call should always be handled
        * by ast_function_expression::hir.
        */
-      assert(0);
-      break;
+      unreachable("ast_function_call: handled elsewhere ");
 
    case ast_identifier: {
       /* ast_identifier can appear several places in a full abstract syntax