aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
diff options
context:
space:
mode:
authorChris Manghane <cmang@google.com>2013-10-14 22:52:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-10-14 22:52:55 +0000
commitb93e0cfdd185098c4b5bb059afb92e0cbe8f235c (patch)
tree41f23c7bb9722e4a5193e9ae568a92f62eb6da05 /gcc/go/go-gcc.cc
parentbe66a22638ada47b4fdf0b42be1d44e6cd4fe104 (diff)
downloadgcc-b93e0cfdd185098c4b5bb059afb92e0cbe8f235c.zip
gcc-b93e0cfdd185098c4b5bb059afb92e0cbe8f235c.tar.gz
gcc-b93e0cfdd185098c4b5bb059afb92e0cbe8f235c.tar.bz2
runtime: Don't clobber saved context when catching signal.
* go-gcc.cc (Gcc_backend::address_expression): New function. From-SVN: r203579
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r--gcc/go/go-gcc.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 81e9ad1..5ff529f 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -235,6 +235,9 @@ class Gcc_backend : public Backend
Bexpression*
function_code_expression(Bfunction*, Location);
+ Bexpression*
+ address_expression(Bexpression*, Location);
+
// Statements.
Bstatement*
@@ -997,6 +1000,19 @@ Gcc_backend::function_code_expression(Bfunction* bfunc, Location location)
return this->make_expression(ret);
}
+// Get the address of an expression.
+
+Bexpression*
+Gcc_backend::address_expression(Bexpression* bexpr, Location location)
+{
+ tree expr = bexpr->get_tree();
+ if (expr == error_mark_node)
+ return this->error_expression();
+
+ tree ret = build_fold_addr_expr_loc(location.gcc_location(), expr);
+ return this->make_expression(ret);
+}
+
// An expression as a statement.
Bstatement*