aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2014-01-14 23:21:16 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-01-14 23:21:16 +0000
commit967d49d1727d0118b7c5c6ab8f46ed5f73f649ca (patch)
treed4a1df753cba6eb19fef4674c91da9b37d530a86 /gcc/go/gofrontend
parentd126a4aed091a5d9cc99e7176326dfc7b22dd41c (diff)
downloadgcc-967d49d1727d0118b7c5c6ab8f46ed5f73f649ca.zip
gcc-967d49d1727d0118b7c5c6ab8f46ed5f73f649ca.tar.gz
gcc-967d49d1727d0118b7c5c6ab8f46ed5f73f649ca.tar.bz2
compiler: Add Backend Function type.
From-SVN: r206611
Diffstat (limited to 'gcc/go/gofrontend')
-rw-r--r--gcc/go/gofrontend/types.cc11
-rw-r--r--gcc/go/gofrontend/types.h24
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 2935523..2148a1a 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -4066,6 +4066,17 @@ Type::make_function_type(Typed_identifier* receiver,
return new Function_type(receiver, parameters, results, location);
}
+// Make a backend function type.
+
+Backend_function_type*
+Type::make_backend_function_type(Typed_identifier* receiver,
+ Typed_identifier_list* parameters,
+ Typed_identifier_list* results,
+ Location location)
+{
+ return new Backend_function_type(receiver, parameters, results, location);
+}
+
// Class Pointer_type.
// Traversal.
diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h
index 980436a..5fda4e7 100644
--- a/gcc/go/gofrontend/types.h
+++ b/gcc/go/gofrontend/types.h
@@ -19,6 +19,7 @@ class Float_type;
class Complex_type;
class String_type;
class Function_type;
+class Backend_function_type;
class Struct_field;
class Struct_field_list;
class Struct_type;
@@ -484,6 +485,12 @@ class Type
Typed_identifier_list* results,
Location);
+ static Backend_function_type*
+ make_backend_function_type(Typed_identifier* receiver,
+ Typed_identifier_list* parameters,
+ Typed_identifier_list* results,
+ Location);
+
static Pointer_type*
make_pointer_type(Type*);
@@ -1896,6 +1903,23 @@ class Function_type : public Type
Btype* fnbtype_;
};
+// The type of a function's backend representation.
+
+class Backend_function_type : public Function_type
+{
+ public:
+ Backend_function_type(Typed_identifier* receiver,
+ Typed_identifier_list* parameters,
+ Typed_identifier_list* results, Location location)
+ : Function_type(receiver, parameters, results, location)
+ { }
+
+ protected:
+ Btype*
+ do_get_backend(Gogo* gogo)
+ { return this->get_backend_fntype(gogo); }
+};
+
// The type of a pointer.
class Pointer_type : public Type