Add ir_function::iterator to iterate over function signatures
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 31 Mar 2010 23:40:26 +0000 (16:40 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 31 Mar 2010 23:40:26 +0000 (16:40 -0700)
ast_to_hir.cpp
ir.h

index 78c92822e303ba0ca88198f830fa3d4b286ee282..e6031ae00464b2d14e005d4c669c64053e4f6ebc 100644 (file)
@@ -1475,7 +1475,7 @@ ast_function_definition::hir(exec_list *instructions,
    const char *const name = this->prototype->identifier;
    f = state->symbols->get_function(name);
    if (f != NULL) {
-      foreach_iter(exec_list_iterator, iter, f->signatures) {
+      foreach_iter(exec_list_iterator, iter, *f) {
         signature = (struct ir_function_signature *) iter.get();
 
         /* Compare the parameter list of the function being defined to the
diff --git a/ir.h b/ir.h
index 2d2da1df7639b3627e13e90b1898f08c9dd1457c..3322ea96404e964577e512b8ac861dcb6466ce91 100644 (file)
--- a/ir.h
+++ b/ir.h
@@ -187,6 +187,14 @@ public:
       signatures.push_tail(sig);
    }
 
+   /**
+    * Get an iterator for the set of function signatures
+    */
+   exec_list_iterator iterator()
+   {
+      return signatures.iterator();
+   }
+
    /**
     * Find a signature that matches a set of actual parameters.
     */