diff options
author | Ian Lance Taylor <iant@google.com> | 2013-11-23 19:01:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-11-23 19:01:57 +0000 |
commit | 18768faed3875e1d33b122fbf867788add95f056 (patch) | |
tree | 4b25b8df89857ef87087b3f0a341c0a0d717af7a /gcc/go/gofrontend/backend.h | |
parent | 7c42f52b7419ea5db30917cf39c15783e5aa2bf5 (diff) | |
download | gcc-18768faed3875e1d33b122fbf867788add95f056.zip gcc-18768faed3875e1d33b122fbf867788add95f056.tar.gz gcc-18768faed3875e1d33b122fbf867788add95f056.tar.bz2 |
compiler: Fix backend representation of calls to interface methods.
Also unify all identical result parameter sets into a single
struct type, and fix the use of backend function pointers.
* go-gcc.cc (Gcc_backend::function_type): Add result_struct
parameter.
From-SVN: r205316
Diffstat (limited to 'gcc/go/gofrontend/backend.h')
-rw-r--r-- | gcc/go/gofrontend/backend.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/backend.h b/gcc/go/gofrontend/backend.h index 6f2c321..8344da4 100644 --- a/gcc/go/gofrontend/backend.h +++ b/gcc/go/gofrontend/backend.h @@ -101,11 +101,15 @@ class Backend // is provided so that the names are available. This should return // not the type of a Go function (which is a pointer to a struct) // but the type of a C function pointer (which will be used as the - // type of the first field of the struct). + // type of the first field of the struct). If there is more than + // one result, RESULT_STRUCT is a struct type to hold the results, + // and RESULTS may be ignored; if there are zero or one results, + // RESULT_STRUCT is NULL. virtual Btype* function_type(const Btyped_identifier& receiver, const std::vector<Btyped_identifier>& parameters, const std::vector<Btyped_identifier>& results, + Btype* result_struct, Location location) = 0; // Get a struct type. @@ -121,10 +125,11 @@ class Backend // NAME is the name of the type, and the location is where the named // type is defined. This function is also used for unnamed function // types with multiple results, in which case the type has no name - // and NAME will be empty. FOR_FUNCTION is true if this is for a Go - // function type, which corresponds to a C/C++ pointer to function - // type. The return value will later be passed as the first - // parameter to set_placeholder_pointer_type or + // and NAME will be empty. FOR_FUNCTION is true if this is for a C + // pointer to function type. A Go func type is represented as a + // pointer to a struct, and the first field of the struct is a C + // pointer to function. The return value will later be passed as + // the first parameter to set_placeholder_pointer_type or // set_placeholder_function_type. virtual Btype* placeholder_pointer_type(const std::string& name, Location, |