diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-11 14:48:51 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-11 14:48:51 -0800 |
commit | cdb8d54b6808b13092cb85e44cf02e4e91c3a669 (patch) | |
tree | 5f650d7c34fc201c116d3753255db4aa6e707fd4 | |
parent | 7e3ed40200ac87c50b84f73409ca0df48fc6a25d (diff) |
Default function parameters to 'in' instead of auto
-rw-r--r-- | ast_to_hir.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index 1fea7299db..c791aec3e2 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -1007,7 +1007,12 @@ ast_parameter_declarator::hir(exec_list *instructions, * FINISHME: complete handling of constant expressions. */ + /* Apply any specified qualifiers to the parameter declaration. Note that + * for function parameters the default mode is 'in'. + */ apply_type_qualifier_to_variable(& this->type->qualifier, var, state); + if (var->mode == ir_var_auto) + var->mode = ir_var_in; instructions->push_tail(var); @@ -1155,7 +1160,7 @@ ast_function_definition::hir(exec_list *instructions, foreach_iter(exec_list_iterator, iter, parameters) { ir_variable *const var = (ir_variable *) iter.get(); - assert(var->mode == ir_op_var_decl); + assert(((ir_instruction *)var)->mode == ir_op_var_decl); iter.remove(); instructions->push_tail(var); |