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.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h
index f53cc6e..33ea9b2 100644
--- a/gcc/go/gofrontend/expressions.h
+++ b/gcc/go/gofrontend/expressions.h
@@ -939,6 +939,11 @@ class Expression
copy()
{ return this->do_copy(); }
+ // Return the cost of this statement for inlining purposes.
+ int
+ inlining_cost()
+ { return this->do_inlining_cost(); }
+
// Return whether the expression is addressable--something which may
// be used as the operand of the unary & operator.
bool
@@ -1084,6 +1089,13 @@ class Expression
virtual Expression*
do_copy() = 0;
+ // Child class implements determining the cost of this statement for
+ // inlining. The default cost is high, so we only need to define
+ // this method for expressions that can be inlined.
+ virtual int
+ do_inlining_cost()
+ { return 0x100000; }
+
// Child class implements whether the expression is addressable.
virtual bool
do_is_addressable() const