aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/expressions.h
diff options
context:
space:
mode:
authorChris Manghane <cmang@google.com>2014-01-24 22:49:06 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-01-24 22:49:06 +0000
commit8a35e18d02fd52813f21072ef8d664806b97a349 (patch)
tree068ef35f26bbcc80832ef93e80c3a72c61be0d26 /gcc/go/gofrontend/expressions.h
parent8adcc78b5fcd47320c710bfe768f1cee9d094e1d (diff)
downloadgcc-8a35e18d02fd52813f21072ef8d664806b97a349.zip
gcc-8a35e18d02fd52813f21072ef8d664806b97a349.tar.gz
gcc-8a35e18d02fd52813f21072ef8d664806b97a349.tar.bz2
compiler: Use backend interface for unary expressions.
* go-gcc.cc (Gcc_backend::unary_expression): New function. From-SVN: r207063
Diffstat (limited to 'gcc/go/gofrontend/expressions.h')
-rw-r--r--gcc/go/gofrontend/expressions.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h
index 9ddd171..575df0f 100644
--- a/gcc/go/gofrontend/expressions.h
+++ b/gcc/go/gofrontend/expressions.h
@@ -403,6 +403,11 @@ class Expression
is_constant() const
{ return this->do_is_constant(); }
+ // Return whether this is an immutable expression.
+ bool
+ is_immutable() const
+ { return this->do_is_immutable(); }
+
// If this is not a numeric constant, return false. If it is one,
// return true, and set VAL to hold the value.
bool
@@ -758,6 +763,11 @@ class Expression
do_is_constant() const
{ return false; }
+ // Return whether this is an immutable expression.
+ virtual bool
+ do_is_immutable() const
+ { return false; }
+
// Return whether this is a constant expression of numeric type, and
// set the Numeric_constant to the value.
virtual bool
@@ -1196,6 +1206,10 @@ class String_expression : public Expression
{ return true; }
bool
+ do_is_immutable() const
+ { return true; }
+
+ bool
do_string_constant_value(std::string* val) const
{
*val = this->val_;