diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-11-27 15:51:01 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-11-27 15:51:01 +0000 |
commit | 862ec76377acf7a20009d755f45d8480868c3fc8 (patch) | |
tree | 25de4037daed56b9de9e55e305cc684602cef5a2 /gcc/go/gofrontend/expressions.cc | |
parent | 56c79e7f5d21660c2e16b2e17d5b48d1df10d92f (diff) | |
download | gcc-862ec76377acf7a20009d755f45d8480868c3fc8.zip gcc-862ec76377acf7a20009d755f45d8480868c3fc8.tar.gz gcc-862ec76377acf7a20009d755f45d8480868c3fc8.tar.bz2 |
compiler: import inlinable functions from package data
Start reading the export data generated by the last change in this
series. At this point we will inline direct calls to empty functions
and methods defined in different packages.
Reviewed-on: https://go-review.googlesource.com/c/150062
From-SVN: r266517
Diffstat (limited to 'gcc/go/gofrontend/expressions.cc')
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 75fa19b..db7c981 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -9785,6 +9785,15 @@ Call_expression::do_lower(Gogo* gogo, Named_object* function, } } + // If this is a call to an imported function for which we have an + // inlinable function body, add it to the list of functions to give + // to the backend as inlining opportunities. + Func_expression* fe = this->fn_->func_expression(); + if (fe != NULL + && fe->named_object()->is_function_declaration() + && fe->named_object()->func_declaration_value()->has_imported_body()) + gogo->add_imported_inlinable_function(fe->named_object()); + return this; } |