aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/backend.h
diff options
context:
space:
mode:
authorChris Manghane <cmang@google.com>2013-10-02 19:22:07 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-10-02 19:22:07 +0000
commit002ee4d12f56b0164ef224cc8c6fad347b8d95c6 (patch)
treee61073212ff346a00a7e58f9b6b0cc315482e7f9 /gcc/go/gofrontend/backend.h
parent99206ca90b8e53db1461366ac4ee4116a2673056 (diff)
downloadgcc-002ee4d12f56b0164ef224cc8c6fad347b8d95c6.zip
gcc-002ee4d12f56b0164ef224cc8c6fad347b8d95c6.tar.gz
gcc-002ee4d12f56b0164ef224cc8c6fad347b8d95c6.tar.bz2
compiler: Use backend interface for numeric expressions.
* go-gcc.cc: Include "real.h" and "realmpfr.h". (Backend::integer_constant_expression): New function. (Backend::float_constant_expression): New function. (Backend::complex_constant_expression): New function. From-SVN: r203127
Diffstat (limited to 'gcc/go/gofrontend/backend.h')
-rw-r--r--gcc/go/gofrontend/backend.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/backend.h b/gcc/go/gofrontend/backend.h
index 18a5947..d0abdd7 100644
--- a/gcc/go/gofrontend/backend.h
+++ b/gcc/go/gofrontend/backend.h
@@ -7,6 +7,9 @@
#ifndef GO_BACKEND_H
#define GO_BACKEND_H
+#include <gmp.h>
+#include <mpfr.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.
@@ -247,6 +250,18 @@ class Backend
virtual Bexpression*
indirect_expression(Bexpression* expr, bool known_valid, Location) = 0;
+ // Return an expression for the multi-precision integer VAL in BTYPE.
+ virtual Bexpression*
+ integer_constant_expression(Btype* btype, mpz_t val) = 0;
+
+ // Return an expression for the floating point value VAL in BTYPE.
+ virtual Bexpression*
+ float_constant_expression(Btype* btype, mpfr_t val) = 0;
+
+ // Return an expression for the complex value REAL/IMAG in BTYPE.
+ virtual Bexpression*
+ complex_constant_expression(Btype* btype, mpfr_t real, mpfr_t imag) = 0;
+
// Statements.
// Create an error statement. This is used for cases which should