summaryrefslogtreecommitdiffstats
path: root/gcc/go/gofrontend/backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/gofrontend/backend.h')
-rw-r--r--gcc/go/gofrontend/backend.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/backend.h b/gcc/go/gofrontend/backend.h
index 6e852161b3f..e3025167fd4 100644
--- a/gcc/go/gofrontend/backend.h
+++ b/gcc/go/gofrontend/backend.h
@@ -10,6 +10,8 @@
#include <gmp.h>
#include <mpfr.h>
+#include "operator.h"
+
// Pointers to these types are created by the backend, passed to the
// frontend, and passed back to the backend. The types must be
// defined by the backend using these names.
@@ -289,10 +291,20 @@ class Backend
compound_expression(Bstatement* bstat, Bexpression* bexpr, Location) = 0;
// Return an expression that executes THEN_EXPR if CONDITION is true, or
- // ELSE_EXPR otherwise. ELSE_EXPR may be NULL.
+ // ELSE_EXPR otherwise and returns the result as type BTYPE. ELSE_EXPR
+ // may be NULL. BTYPE may be NULL.
+ virtual Bexpression*
+ conditional_expression(Btype* btype, Bexpression* condition,
+ Bexpression* then_expr, Bexpression* else_expr,
+ Location) = 0;
+
+ // Return an expression for the binary operation LEFT OP RIGHT.
+ // Supported values of OP are (from operators.h):
+ // EQEQ, NOTEQ, LT, LE, GT, GE, PLUS, MINUS, OR, XOR, MULT, DIV, MOD,
+ // LSHIFT, RSHIFT, AND, NOT.
virtual Bexpression*
- conditional_expression(Bexpression* condition, Bexpression* then_expr,
- Bexpression* else_expr, Location) = 0;
+ binary_expression(Operator op, Bexpression* left, Bexpression* right,
+ Location) = 0;
// Statements.
OpenPOWER on IntegriCloud