aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
AgeCommit message (Collapse)AuthorFilesLines
2011-06-11Use backend interface for type descriptors.Ian Lance Taylor1-0/+88
* go-gcc.cc: Include "toplev.h". (Gcc_backend::immutable_struct): New function. (Gcc_backend::immutable_struct_set_init): New function. (Gcc_backend::immutable_struct_reference): New function. * Make-lang.in (go/go-gcc.o): Depend on toplev.h. From-SVN: r174941
2011-06-09Use backend interface for zero initialization.Ian Lance Taylor1-0/+19
* go-gcc.cc (Gcc_backend::zero_expression): New function. From-SVN: r174863
2011-05-13Fix bug with multiple results returning structs with invalid sizes.Ian Lance Taylor1-4/+8
* go-gcc.cc (Gcc_backend::function_type): When building a struct for multiple results, check that all fields types have a size. (Gcc_backend::placeholder_pointer_type): Permit name to be empty. From-SVN: r173742
2011-05-12Fix bug with taking address of a variable when address does not escape.Ian Lance Taylor1-4/+10
* go-gcc.cc (Gcc_backend::local_variable): Add is_address_taken parameter. (Gcc_backend::parameter_variable): Likewise. From-SVN: r173712
2011-05-06generalize build_case_label to the rest of the compilerNathan Froyd1-4/+2
generalize build_case_label to the rest of the compiler gcc/ada/ * gcc-interface/trans.c (Case_Statement_to_gnu): Call build_case_label. gcc/ * except.c (sjlj_emit_dispatch_table): Call build_case_label. * gimplify.c (gimplify_switch_expr): Likewise. * omp-low.c (expand_omp_sections): Likewise. * tree-eh.c (lower_try_finally_switch): Likewise. (lower_eh_dispatch): Likewise. * tree.h (build_case_label): Declare. * tree.c (build_case_label): Define. gcc/c-family/ * c-common.c (c_add_case_label): Omit the loc argument to build_case_label. * c-common.h (build_case_label): Remove. * c-semantics.c (build_case_label): Remove. gcc/cp/ * decl.c (finish_case_label): Omit the loc argument to build_case_label. gcc/fortran/ * trans-decl.c (gfc_trans_entry_master_switch): Call build_case_label. * trans-io.c (add_case): Likewise. * trans-stmt.c (gfc_trans_integer_select): Likewise. (gfc_trans_character_select): Likewise. gcc/go/ * go-gcc.cc (Gcc_backend::switch_statement): Call build_case_label. gcc/java/ * expr.c (expand_java_switch): Call build_case_label. (expand_java_add_case): Likewise. From-SVN: r173467
2011-05-04Use backend interface for named types and array types.Ian Lance Taylor1-6/+228
* go-gcc.cc (Gcc_backend::struct_type): Call fill_in_struct. (Gcc_backend::fill_in_struct): New function. (Gcc_backend::array_type): Implement. (Gcc_backend::fill_in_array): New function. (Gcc_backend::placeholder_pointer_type): New function. (Gcc_backend::set_placeholder_pointer_type): New function. (Gcc_backend::set_placeholder_function_type): New function. (Gcc_backend::placeholder_struct_type): New function. (Gcc_backend::set_placeholder_struct_type): New function. (Gcc_backend::placeholder_array_type): New function. (Gcc_backend::set_placeholder_array_type): New function. (Gcc_backend::named_type): New function. (Gcc_backend::circular_pointer_type): New function. (Gcc_backend::is_circular_pointer_type): New function. From-SVN: r173380
2011-04-27Use backend interface for struct types.Ian Lance Taylor1-2/+27
* go-gcc.cc (Gcc_backend::struct_type): Implement. From-SVN: r173004
2011-04-25Use backend interface for function types.Ian Lance Taylor1-30/+86
Drop type_tree() functions for Float_type and Complex_type. Don't define builtin functions until gogo is created. * go-gcc.cc (Gcc_backend::error_type): Implement. (Gcc_backend::string_type): Remove. (Gcc_backend::function_type): Change signature and implement. (Gcc_backend::struct_type): Change signature. (Gcc_backend::slice_type, Gcc_backend::map_type): Remove. (Gcc_backend::channel_type, Gcc_backend::interface_type): Remove. (Gcc_backend::pointer_type): Check for error. * Make-lang.in (go/types.o): Depend on go/gofrontend/backend.h. From-SVN: r172932
2011-04-25Use backend interface for basic typesEvan Shaw1-7/+113
* go-gcc.c (class Gcc_tree): Make get_tree const. (Gcc_backend::void_type): Implement. (Gcc_backend::bool_type): Implement. (Gcc_backend::integer_type): Implement. (Gcc_backend::float_type): Implement. (Gcc_backend::complex_type): New function. (Gcc_backend::pointer_type): New function. (Gcc_backend::make_type): New function. (type_to_tree): New function. From-SVN: r172931
2011-04-19Use backend interface for temporary variables.Ian Lance Taylor1-0/+66
* go-gcc.cc (Gcc_backend::temporary_variable): New function. From-SVN: r172737
2011-04-19Use backend interface for blocks.Ian Lance Taylor1-4/+145
* go-gcc.cc (class Bblock): Define. (Gcc_backend::if_statement): Change then_block and else_block to Bblock*. (Gcc_backend::block): New function. (Gcc_backend::block_add_statements): New function. (Gcc_backend::block_statement): New function. (tree_to_block, block_to_tree): New functions. From-SVN: r172731
2011-04-19Use backend interface for variables.Ian Lance Taylor1-0/+159
* go-gcc.cc: Include "go-c.h". (class Bvariable): Define. (Gcc_backend::init_statement): New function. (Gcc_backend::global_variable): New function. (Gcc_backend::global_variable_set_init): New function. (Gcc_backend::local_variable): New function. (Gcc_backend::parameter_variable): New function. (tree_to_type, var_to_tree): New functions. * Make-lang.in (go/go-gcc.o): Depend on $(GO_C_H). * (go/gogo-tree.o): Depend on go/gofrontend/backend.h. From-SVN: r172693
2011-04-15Add compound_list to backend interface.Ian Lance Taylor1-10/+30
* go-gcc.cc (Gcc_backend::compound_statement): New function. (Gcc_backend::assignment_statement): Use error_statement. (Gcc_backend::return_statement): Likewise. (Gcc_backend::if_statement): Likewise. (Gcc_backend::switch_statement): Likewise. (Gcc_backend::statement_list): Likewise. From-SVN: r172521
2011-04-15Use the backend interface for select statements.Ian Lance Taylor1-0/+4
From-SVN: r172468
2011-04-06Use backend interface for constant switch statements.Ian Lance Taylor1-3/+90
* go-gcc.cc (if_statement): Use build3_loc. (Gcc_backend::switch_statement): New function. (Gcc_backend::statement_list): New function. From-SVN: r172066
2011-04-06Use backend interface for if statements.Ian Lance Taylor1-2/+31
Rename some temporary conversion functions to shorter names. * go-gcc.cc (Gcc_backend::if_statement): New function. (tree_to_stat): New function. (expr_to_tree): Renamed from expression_to_tree. (stat_to_tree): Renamed from statement_to_tree. From-SVN: r172052
2011-04-06Use backend interface for expression statements.Ian Lance Taylor1-0/+12
* go-gcc.cc (Gcc_backend::expression_statement): New function. From-SVN: r172051
2011-04-05Use backend interface for labels and goto statements.Ian Lance Taylor1-2/+92
* go-gcc.c (class Blabel): Define. (Gcc_backend::make_expression): New function. (get_identifier_from_string): New function. (Gcc_backend::label): New function. (Gcc_backend::label_definition_statement): New function. (Gcc_backend::goto_statement): New function. (Gcc_backend::label_address): New function. (expression_to_tree): New function. * Make-lang.in (go/expressions.o): Depend on go/gofrontend/backend.h. (go/gogo.o): Likewise. From-SVN: r171968
2011-04-04Use backend interface for return statements.Ian Lance Taylor1-6/+90
* go-gcc.cc: #include "tree-iterator.h", "gimple.h", and "gogo.h". (class Bfunction): Define. (Gcc_backend::assignment_statement): Rename from assignment. Check for errors. (Gcc_backend::return_statement): New function. (tree_to_function): New function. * Make-lang.in (go/go-gcc.o): Depend on tree-iterator.h, $(GIMPLE_H), and $(GO_GOGO_H). From-SVN: r171959
2011-04-03Start using backend interface separate from gofrontend.Ian Lance Taylor1-0/+199
* go-gcc.cc: New file. * Make-lang.in (GO_OBJS): Add go/go-gcc.o. (go/go-gcc.o): New target. (go/go.o): Depend on go/gofrontend/backend.h. (go/statements.o): Likewise. From-SVN: r171917