aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/expressions.h
diff options
context:
space:
mode:
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_;