diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-06-10 21:34:12 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-06-10 21:34:12 +0000 |
commit | e898243c23c82247ec01b32f551402ca52f32927 (patch) | |
tree | b0d9c35dc562318a0568ad5a47888711864bc4c1 /gcc/go/gofrontend/statements.cc | |
parent | 35c19de69645b18eeef7dbecfcd98b19f9948c84 (diff) | |
download | gcc-e898243c23c82247ec01b32f551402ca52f32927.zip gcc-e898243c23c82247ec01b32f551402ca52f32927.tar.gz gcc-e898243c23c82247ec01b32f551402ca52f32927.tar.bz2 |
compiler: support inlining functions that use index expressions
Also move the determine_types pass on an inlined function body to one
place, rather than doing it ad hoc as needed.
This adds 79 new inlinable functions in the standard library, such as
bytes.HasPrefix and bytes.LastIndexByte.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/181261
From-SVN: r272133
Diffstat (limited to 'gcc/go/gofrontend/statements.cc')
-rw-r--r-- | gcc/go/gofrontend/statements.cc | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index 9ab1172..7f424fd 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -465,8 +465,6 @@ Variable_declaration_statement::do_import(Import_function_body* ifb, { ifb->advance(3); init = Expression::import_expression(ifb, loc); - Type_context context(type, false); - init->determine_type(&context); } Variable* var = new Variable(type, init, false, false, false, loc); var->set_is_used(); @@ -753,11 +751,6 @@ Temporary_statement::do_import(Import_function_body* ifb, Location loc) { ifb->advance(3); init = Expression::import_expression(ifb, loc); - if (type != NULL) - { - Type_context context(type, false); - init->determine_type(&context); - } } if (type == NULL && init == NULL) { @@ -3730,8 +3723,6 @@ If_statement::do_import(Import_function_body* ifb, Location loc) ifb->require_c_string("if "); Expression* cond = Expression::import_expression(ifb, loc); - Type_context context(Type::lookup_bool_type(), false); - cond->determine_type(&context); ifb->require_c_string(" "); if (!ifb->match_c_string("{")) |