aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
AgeCommit message (Collapse)AuthorFilesLines
2011-04-25Use backend interface for function types.Ian Lance Taylor10-172/+178
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 Shaw4-68/+156
* 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-23Define go_unreachable to replace gcc_unreachable.Ian Lance Taylor13-155/+153
From Evan Shaw. From-SVN: r172882
2011-04-21Define go_assert to replace gcc_assertIan Lance Taylor21-595/+605
This is defined in go-system.h in the backend. * go-system.h (go_assert, go_unreachable): Define. From-SVN: r172846
2011-04-21Use mpfr_prec_round, not real_convert, to constraint floats.Ian Lance Taylor1-17/+3
From-SVN: r172811
2011-04-19statement.cc no longer includes gcc headers.Ian Lance Taylor5-97/+64
* go-system.h: Include "intl.h". * Make-lang.in (GO_SYSTEM_H): Add intl.h. (go/statements.o): Remove dependencies on intl.h $(TREE_H) $(GIMPLE_H) convert.h tree-iterator.h $(TREE_FLOW_H) $(REAL_H). From-SVN: r172743
2011-04-19Change general statement method to always use backend interface.Ian Lance Taylor4-160/+137
From-SVN: r172740
2011-04-19Use backend interface for temporary variables.Ian Lance Taylor6-71/+152
* go-gcc.cc (Gcc_backend::temporary_variable): New function. From-SVN: r172737
2011-04-19Use backend interface for blocks.Ian Lance Taylor8-138/+292
* 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 Taylor9-262/+532
* 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 Taylor4-37/+50
* 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 backend interface for send statement.Ian Lance Taylor4-154/+112
From-SVN: r172519
2011-04-15Use the backend interface for select statements.Ian Lance Taylor8-139/+209
From-SVN: r172468
2011-04-13Use backend interface for go and defer statements.Ian Lance Taylor7-130/+133
Change defer stack from tree to Expression. From-SVN: r172402
2011-04-13Unify handling of runtime support functions.Ian Lance Taylor9-443/+1009
This introduces the new approach, and rewrites the lowering code which uses runtime functions. The code which calls runtime functions at GENERIC conversion time is not yet rewritten. From-SVN: r172396
2011-04-13ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling ↵Nathan Froyd2-1/+6
TREE_CHAIN. gcc/ada/ * gcc-interface/ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * gcc-interface/misc.c (gnat_init_ts): New function. (LANG_HOOKS_INIT_TS): Define. gcc/ * c-decl.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * print-tree.c (print_node): Likewise. * tree-inline.c (copy_tree_r): Likewise. * c-lang.c (LANG_HOOKS_INIT_TS): Define. * lto-streamer-in.c (lto_input_tree_pointers): Check for TS_TYPED instead of TS_COMMON. * lto-streamer-out.c (lto_output_tree_pointers): Likewise. * tree.c (initialize_tree_contains_struct): Handle TS_TYPED. (copy_node_stat): Zero TREE_CHAIN only if necessary. (MARK_TS_BASE, MARK_TS_TYPED, MARK_TS_COMMON): Move these... (MARK_TS_DECL_COMMON, MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL): ...and these... (MARK_TS_DECL_WITH_VIS, MARK_TS_DECL_NON_COMMON): ...and these... * tree.h: ...here. (TREE_CHAIN): Check for a TS_COMMON structure. (TREE_TYPE): Check for a TS_TYPED structure. gcc/c-family/ * c-common.h (c_common_init_ts): Declare. * c-common.c (c_common_init_ts): Define. gcc/cp/ * cp-lang.c (cp_init_ts): Call cp_common_init_ts. Move tree_contains_struct initialization to... * cp-objcp-common.c (cp_common_init_ts): ...here. Use MARK_* macros. * cp-objcp-common.h (cp_common_init_ts): Declare. * cp-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/fortran/ * f95-lang.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/go/ * go-lang.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/java/ * java-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/lto/ * lto-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * lto.c (lto_fixup_common): Likewise. gcc/objc/ * objc-lang.c (objc_init_ts): Move code for this function... * objc-act.c (objc_common_init_ts): ...here. Define. * objc-act.h (objc_common_init_ts): Declare. gcc/objcp/ * objcp-lang.c (objcxx_init_ts): Call objc_common_init_ts and cp_common_init_ts. From-SVN: r172359
2011-04-12Call cgraph_get_node rather than cgraph_node.Ian Lance Taylor1-1/+1
This is for a recent change to the gcc middle-end. From-SVN: r172335
2011-04-06Use backend interface for constant switch statements.Ian Lance Taylor5-81/+271
* 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 Taylor5-29/+71
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 Taylor4-2/+32
* go-gcc.cc (Gcc_backend::expression_statement): New function. From-SVN: r172051
2011-04-05Use backend interface for labels and goto statements.Ian Lance Taylor9-99/+267
* 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 Taylor12-289/+254
* 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 Taylor8-12/+361
* 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
2011-03-31Taking a slice of an array requires moving the array to the heap.Ian Lance Taylor1-4/+7
From-SVN: r171792
2011-03-29Fix select setting a map expression.Ian Lance Taylor1-24/+26
Also fix select parsing when declaring a variable with no statements. From-SVN: r171690
2011-03-28Permit copying hidden fields when passing method receiver.Ian Lance Taylor3-7/+45
From-SVN: r171641
2011-03-28Better error message for invalid variable name in switch statement.Ian Lance Taylor1-0/+13
From-SVN: r171639
2011-03-28Better error message for missing condition in if statement.Ian Lance Taylor1-0/+6
From-SVN: r171638
2011-03-28Better error message for old syntax of send expression as value.Ian Lance Taylor2-19/+72
From-SVN: r171637
2011-03-28Better error messages for missing channel element type.Ian Lance Taylor1-0/+17
From-SVN: r171634
2011-03-28Do not permit method expressions with pointers to interface types.Ian Lance Taylor1-3/+5
From-SVN: r171633
2011-03-28Support method expressions for interface types.Ian Lance Taylor1-5/+26
From-SVN: r171631
2011-03-28Don't bother to check for duplicate interface/named methods.Ian Lance Taylor1-9/+1
A named interface type can't have named methods anyhow. From-SVN: r171630
2011-03-28Fix useless assertion in ^ code.Ian Lance Taylor1-1/+1
From-SVN: r171619
2011-03-27Error for return with no values when result parameters are not named.Ian Lance Taylor1-3/+13
From-SVN: r171576
2011-03-27Improve error about indirecting an unsafe.Pointer type.Ian Lance Taylor1-0/+8
From-SVN: r171574
2011-03-26Don't look up methods for pointer to interface.Ian Lance Taylor1-5/+4
From-SVN: r171562
2011-03-26Don't permit embedded field to be pointer to interface.Ian Lance Taylor2-1/+12
From-SVN: r171558
2011-03-26Check for invalid uses of ... in builtin function calls.Ian Lance Taylor2-0/+12
From-SVN: r171544
2011-03-26Better error when setting const to nil.Ian Lance Taylor1-1/+3
From-SVN: r171541
2011-03-26Correctly parse select case <-c <- v.Ian Lance Taylor1-4/+12
From-SVN: r171540
2011-03-25Clean up handling of undefined types.Ian Lance Taylor5-91/+60
From-SVN: r171528
2011-03-25Avoid overflow error after negative shift count error.Ian Lance Taylor1-1/+7
From-SVN: r171523
2011-03-25Give an error if a label is defined but not used.Ian Lance Taylor4-28/+90
From-SVN: r171518
2011-03-25Remove closed function. Fix tuple receive in select.Ian Lance Taylor5-68/+67
From-SVN: r171440
2011-03-24Tuple receives indicate whether channel is closed.Ian Lance Taylor7-128/+279
From-SVN: r171380
2011-03-24Condition in if statement is not optional.Ian Lance Taylor2-28/+13
From-SVN: r171377
2011-03-24Change c <- v from an expression to a statement.Ian Lance Taylor7-204/+171
Don't do anything special if we don't use the value of <-c. Fix sending an untyped constant in a select statement. From-SVN: r171371
2011-03-16Update to current version of Go library (revision 94d654be2064).Ian Lance Taylor1-2/+14
From-SVN: r171076
2011-03-07Support multiple init functions in a single file.Ian Lance Taylor2-21/+19
From-SVN: r170756