diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-04 12:54:49 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-12-04 12:54:49 +0000 |
commit | bdff91a14bf8e5d18b1eb47bb529894482065762 (patch) | |
tree | 4515b21fe5d3e25b4d5c8f907d3e78834e1e40ac /gcc/go/go-gcc.cc | |
parent | 0158370253d4aef042c4d67b2c0278ded58d83fd (diff) | |
parent | 8192796762b4781de57ce2a6c104a71dcbd874e3 (diff) | |
download | gcc-bdff91a14bf8e5d18b1eb47bb529894482065762.tar.gz |
Merge with trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@205668 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r-- | gcc/go/go-gcc.cc | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 578aff0b27a..183a9a3b3ad 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -29,7 +29,8 @@ #include "stor-layout.h" #include "varasm.h" #include "tree-iterator.h" -#include "gimple.h" +#include "basic-block.h" +#include "gimple-expr.h" #include "toplev.h" #include "output.h" #include "real.h" @@ -157,6 +158,7 @@ class Gcc_backend : public Backend function_type(const Btyped_identifier&, const std::vector<Btyped_identifier>&, const std::vector<Btyped_identifier>&, + Btype*, const Location); Btype* @@ -492,7 +494,8 @@ Btype* Gcc_backend::function_type(const Btyped_identifier& receiver, const std::vector<Btyped_identifier>& parameters, const std::vector<Btyped_identifier>& results, - Location location) + Btype* result_struct, + Location) { tree args = NULL_TREE; tree* pp = &args; @@ -527,29 +530,8 @@ Gcc_backend::function_type(const Btyped_identifier& receiver, result = results.front().btype->get_tree(); else { - result = make_node(RECORD_TYPE); - tree field_trees = NULL_TREE; - pp = &field_trees; - for (std::vector<Btyped_identifier>::const_iterator p = results.begin(); - p != results.end(); - ++p) - { - const std::string name = (p->name.empty() - ? "UNNAMED" - : p->name); - tree name_tree = get_identifier_from_string(name); - tree field_type_tree = p->btype->get_tree(); - if (field_type_tree == error_mark_node) - return this->error_type(); - gcc_assert(TYPE_SIZE(field_type_tree) != NULL_TREE); - tree field = build_decl(location.gcc_location(), FIELD_DECL, - name_tree, field_type_tree); - DECL_CONTEXT(field) = result; - *pp = field; - pp = &DECL_CHAIN(field); - } - TYPE_FIELDS(result) = field_trees; - layout_type(result); + gcc_assert(result_struct != NULL); + result = result_struct->get_tree(); } if (result == error_mark_node) return this->error_type(); |