From 95cd6cc195f4652378d7ecf614c6e1c568311a04 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 31 Mar 2010 16:40:26 -0700 Subject: [PATCH] Add ir_function::iterator to iterate over function signatures --- ast_to_hir.cpp | 2 +- ir.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index 78c9282..e6031ae 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -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 2d2da1d..3322ea9 100644 --- a/ir.h +++ b/ir.h @@ -188,6 +188,14 @@ public: } /** + * 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. */ const ir_function_signature *matching_signature(exec_list *actual_param); -- 2.7.4