fix-up inlined/non-inlined function inconsistencies
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 14 May 2008 22:32:18 +0000 (16:32 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 14 May 2008 22:32:18 +0000 (16:32 -0600)
cherry-picked from master

src/mesa/shader/slang/slang_codegen.c
src/mesa/shader/slang/slang_compile_operation.h

index 8ea6a8dcd9c5d5a4c3625071121a6c7facb7a3f3..8e4c10ff4320c69027292f72881ea81c1732f157 100644 (file)
@@ -538,10 +538,10 @@ new_not(slang_ir_node *n)
 
 
 /**
- * Inlined subroutine.
+ * Non-inlined function call.
  */
 static slang_ir_node *
-new_inlined_function_call(slang_ir_node *code, slang_label *name)
+new_function_call(slang_ir_node *code, slang_label *name)
 {
    slang_ir_node *n = new_node1(IR_CALL, code);
    assert(name);
@@ -1229,7 +1229,7 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun,
          else {
             callOper = inlined;
          }
-         callOper->type = SLANG_OPER_INLINED_CALL;
+         callOper->type = SLANG_OPER_NON_INLINED_CALL;
          callOper->fun = fun;
          callOper->label = _slang_label_new_unique((char*) fun->header.a_name);
       }
@@ -2552,7 +2552,7 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper)
                _slang_free_ir_tree(tree);
                return NULL; /* error must have occured */
             }
-            tree = tree ? new_seq(tree, n) : n;
+            tree = new_seq(tree, n);
          }
 
 #if 00
@@ -2779,17 +2779,17 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper)
         return n;
       }
 
-   case SLANG_OPER_INLINED_CALL:
+   case SLANG_OPER_NON_INLINED_CALL:
    case SLANG_OPER_SEQUENCE:
       {
          slang_ir_node *tree = NULL;
          GLuint i;
          for (i = 0; i < oper->num_children; i++) {
             slang_ir_node *n = _slang_gen_operation(A, &oper->children[i]);
-            tree = tree ? new_seq(tree, n) : n;
+            tree = new_seq(tree, n);
          }
-         if (oper->type == SLANG_OPER_INLINED_CALL) {
-            tree = new_inlined_function_call(tree, oper->label);
+         if (oper->type == SLANG_OPER_NON_INLINED_CALL) {
+            tree = new_function_call(tree, oper->label);
          }
          return tree;
       }
index d497b6f66f70a1a0e13c5f92728803e594a8cf28..d5cbe779a6c5d9b83a7db01bcb880271b4efb9b1 100644 (file)
@@ -93,7 +93,7 @@ typedef enum slang_operation_type_
    SLANG_OPER_NOT,              /* "!" [expr] */
    SLANG_OPER_SUBSCRIPT,        /* [expr] "[" [expr] "]" */
    SLANG_OPER_CALL,             /* [func name] [param] [param] [...] */
-   SLANG_OPER_INLINED_CALL,     /* inlined function call */
+   SLANG_OPER_NON_INLINED_CALL, /* a real function call */
    SLANG_OPER_FIELD,            /* i.e.: ".next" or ".xzy" or ".xxx" etc */
    SLANG_OPER_POSTINCREMENT,    /* [var] "++" */
    SLANG_OPER_POSTDECREMENT     /* [var] "--" */