From 0514cb33749fefd2542e7294a35d0ef0ccae30b3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Jun 2019 22:00:57 +0000 Subject: compiler: open code some type assertions Now that type equality is just simple pointer equality, we can open code some type assertions instead of making runtime calls. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182977 From-SVN: r272577 --- gcc/go/gofrontend/expressions.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/go/gofrontend/expressions.h') diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index 2c505a9..2c6a080 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -1074,6 +1074,11 @@ class Expression static Expression* unpack_direct_iface(Expression*, Location); + // Return an expression representing the type descriptor field of an + // interface. + static Expression* + get_interface_type_descriptor(Expression*); + // Look through the expression of a Slice_value_expression's valmem to // find an call to makeslice. static std::pair @@ -1257,9 +1262,6 @@ class Expression } static Expression* - get_interface_type_descriptor(Expression*); - - static Expression* convert_interface_to_type(Type*, Expression*, Location); static Expression* -- cgit v1.1