This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Use backend interface for type info expressions
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Mon, 05 May 2014 17:48:53 -0400
- Subject: Go patch committed: Use backend interface for type info expressions
- Authentication-results: sourceware.org; auth=none
This patch by Chris Manghane changes the Go frontend to use the backend
interface for type info expressions. Bootstrapped and ran Go testsuite
on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 1a6ec84147d3 go/expressions.cc
--- a/go/expressions.cc Mon May 05 15:05:17 2014 -0400
+++ b/go/expressions.cc Mon May 05 17:08:57 2014 -0400
@@ -14095,9 +14095,13 @@
default:
go_unreachable();
}
- tree val_type_tree = type_to_tree(this->type()->get_backend(gogo));
- go_assert(val_type_tree != error_mark_node);
- return build_int_cstu(val_type_tree, val);
+ mpz_t cst;
+ mpz_init_set_ui(cst, val);
+ Btype* int_btype = this->type()->get_backend(gogo);
+ Bexpression* ret =
+ gogo->backend()->integer_constant_expression(int_btype, cst);
+ mpz_clear(cst);
+ return expr_to_tree(ret);
}
// Dump ast representation for a type info expression.