diff options
author | Chris Manghane <cmang@google.com> | 2014-01-17 04:35:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-01-17 04:35:40 +0000 |
commit | b5407ad1efa9c19efa34d187ad9ee60f248ede60 (patch) | |
tree | e2af79a4381d2e47953832502a194400882303e5 /gcc/go/gofrontend/expressions.h | |
parent | f910753dbe1faad4ec8295f621c5177214fe8232 (diff) | |
download | gcc-b5407ad1efa9c19efa34d187ad9ee60f248ede60.zip gcc-b5407ad1efa9c19efa34d187ad9ee60f248ede60.tar.gz gcc-b5407ad1efa9c19efa34d187ad9ee60f248ede60.tar.bz2 |
compiler: Use backend interface for binary expressions.
* go-gcc.cc (Gcc_backend::conditional_expression): Add btype
parameter.
(operator_to_tree_code): New static function.
(Gcc_backend::binary_expression): New function.
From-SVN: r206696
Diffstat (limited to 'gcc/go/gofrontend/expressions.h')
-rw-r--r-- | gcc/go/gofrontend/expressions.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index 83bc724..9ddd171 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -704,11 +704,11 @@ class Expression Type* rhs_type, tree rhs_tree, bool for_type_guard, Location); - // Return a tree implementing the comparison LHS_EXPR OP RHS_EXPR. + // Return a backend expression implementing the comparison LEFT OP RIGHT. // TYPE is the type of both sides. - static tree - comparison_tree(Translate_context*, Type* result_type, Operator op, - Expression* left_expr, Expression* right_expr, Location); + static Bexpression* + comparison(Translate_context*, Type* result_type, Operator op, + Expression* left, Expression* right, Location); // Return the backend expression for the numeric constant VAL. static Bexpression* @@ -1289,6 +1289,9 @@ class Binary_expression : public Expression Expression* do_lower(Gogo*, Named_object*, Statement_inserter*, int); + Expression* + do_flatten(Gogo*, Named_object*, Statement_inserter*); + bool do_is_constant() const { return this->left_->is_constant() && this->right_->is_constant(); } |