From 5a9422664e8646313278d50666e2e4c8427cd5df Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 5 Jun 2019 21:05:38 +0000 Subject: compiler: inline call expressions and function references Scan inlinable methods for references to global variables and functions (forgot to do that earlier). Track all packages mentioned by exports (that should have been done earlier too). Record assembler name in export data, so that we can inline calls to non-Go functions. Modify gccgoimporter code to skip assembler name. This increases the number of inlinable functions in the standard library from 215 to 439. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/180677 From-SVN: r271976 --- gcc/go/gofrontend/expressions.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gcc/go/gofrontend/expressions.h') diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index e17e8dc..fc1c5a8 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -1253,6 +1253,9 @@ class Expression static Expression* import_identifier(Import_function_body*, Location); + static Expression* + import_expression_without_suffix(Import_expression*, Location); + // The expression classification. Expression_classification classification_; // The location in the input file. @@ -2409,6 +2412,12 @@ class Call_expression : public Expression virtual Bexpression* do_get_backend(Translate_context*); + int + do_inlining_cost() const; + + void + do_export(Export_function_body*) const; + virtual bool do_is_recover_call() const; @@ -2432,6 +2441,9 @@ class Call_expression : public Expression determining_types(); void + export_arguments(Export_function_body*) const; + + void do_dump_expression(Ast_dump_context*) const; void @@ -2571,6 +2583,10 @@ class Builtin_call_expression : public Call_expression Bexpression* do_get_backend(Translate_context*); + int + do_inlining_cost() const + { return 1; } + void do_export(Export_function_body*) const; @@ -2745,6 +2761,12 @@ class Func_expression : public Expression Bexpression* do_get_backend(Translate_context*); + int + do_inlining_cost() const; + + void + do_export(Export_function_body*) const; + void do_dump_expression(Ast_dump_context*) const; -- cgit v1.1