Clarify the types of various exec_list in ir.h
authorEric Anholt <eric@anholt.net>
Wed, 7 Apr 2010 19:35:34 +0000 (12:35 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 8 Apr 2010 00:23:23 +0000 (17:23 -0700)
ast_function.cpp
ir.h

index cd57c32..3472b39 100644 (file)
@@ -38,7 +38,7 @@ process_parameters(exec_list *instructions, exec_list *actual_parameters,
    if (first != NULL) {
       simple_node *ptr = first;
       do {
-        ir_instruction *const result =
+        ir_rvalue *const result =
            ((ast_node *) ptr)->hir(instructions, state);
         ptr = ptr->next;
 
@@ -71,10 +71,8 @@ process_call(exec_list *instructions, ir_function *f,
       exec_list_iterator formal_iter = sig->parameters.iterator();
 
       while (actual_iter.has_next()) {
-        ir_rvalue *actual =
-           ((ir_instruction *) actual_iter.get())->as_rvalue();
-        ir_variable *formal =
-           ((ir_instruction *) formal_iter.get())->as_variable();
+        ir_rvalue *actual = (ir_rvalue *) actual_iter.get();
+        ir_variable *formal = (ir_variable *) formal_iter.get();
 
         assert(actual != NULL);
         assert(formal != NULL);
diff --git a/ir.h b/ir.h
index 13d0715..7ae5e3b 100644 (file)
--- a/ir.h
+++ b/ir.h
@@ -204,7 +204,10 @@ public:
    const struct glsl_type *return_type;
 
    /**
-    * List of function parameters stored as ir_variable objects.
+    * List of ir_variable of function parameters.
+    *
+    * This represents the storage.  The paramaters passed in a particular
+    * call will be in ir_call::actual_paramaters.
     */
    struct exec_list parameters;
 
@@ -259,7 +262,7 @@ public:
 
 private:
    /**
-    * Set of overloaded functions with this name.
+    * List of ir_function_signature for each overloaded function with this name.
     */
    struct exec_list signatures;
 };
@@ -288,7 +291,9 @@ public:
    }
 
    ir_rvalue *condition;
+   /** List of ir_instruction for the body of the then branch */
    exec_list  then_instructions;
+   /** List of ir_instruction for the body of the else branch */
    exec_list  else_instructions;
 };
 
@@ -321,7 +326,7 @@ public:
       return body_instructions.iterator();
    }
 
-   /** List of instructions that make up the body of the loop. */
+   /** List of ir_instruction that make up the body of the loop. */
    exec_list body_instructions;
 
    /**
@@ -497,6 +502,8 @@ private:
    }
 
    const ir_function_signature *callee;
+
+   /* List of ir_rvalue of paramaters passed in this call. */
    exec_list actual_parameters;
 };