GCC Middle and Back End API Reference
|
Data Structures | |
struct | macro_hash_value |
struct | godump_container |
Functions | |
static hashval_t | macro_hash_hashval () |
static int | macro_hash_eq () |
static void | macro_hash_del () |
static int | string_hash_eq () |
static void | go_define () |
static void | go_undef () |
static void | go_decl () |
static void | go_function_decl () |
static void | go_global_decl () |
static void | go_type_decl () |
static void | go_append_string () |
static bool | go_format_type (struct godump_container *container, tree type, bool use_type_name, bool is_func_ok) |
static void | go_output_type () |
static void | go_output_fndecl () |
static void | go_output_typedef () |
static void | go_output_var () |
static int | go_print_macro () |
static void | keyword_hash_init () |
static bool | find_dummy_types () |
static void | go_finish () |
struct gcc_debug_hooks * | dump_go_spec_init () |
Variables | |
static struct gcc_debug_hooks | go_debug_hooks |
static struct gcc_debug_hooks * | real_debug_hooks |
static FILE * | go_dump_file |
static vec< tree, va_gc > * | queue |
static htab_t | macro_hash |
static const char *const | keywords [] |
|
read |
Set up our hooks.
References gcc_debug_hooks::define, error(), gcc_debug_hooks::finish, gcc_debug_hooks::function_decl, gcc_debug_hooks::global_decl, go_debug_hooks, go_define(), go_dump_file, go_finish(), go_function_decl(), go_global_decl(), go_type_decl(), go_undef(), macro_hash, macro_hash_del(), macro_hash_eq(), macro_hash_hashval(), gcc_debug_hooks::type_decl, and gcc_debug_hooks::undef.
|
static |
Traversing the pot_dummy_types and seeing which types are present in the global types hash table and creating dummy definitions if not found. This function is invoked by pointer_set_traverse.
References go_dump_file, godump_container::invalid_hash, and godump_container::type_hash.
Referenced by go_finish().
|
static |
Append an IDENTIFIER_NODE to OB.
Referenced by go_format_type().
|
static |
A function or variable decl.
References queue, and vec_safe_push().
Referenced by go_function_decl(), and go_global_decl().
|
static |
A macro definition.
References buffer, copy(), count, gcc_debug_hooks::define, go_dump_file, macro_hash, macro_hash_del(), memcpy(), macro_hash_value::name, strlen(), unknown, and macro_hash_value::value.
Referenced by dump_go_spec_init().
|
static |
Output symbols.
References godump_container::decls_seen, error(), find_dummy_types(), gcc_debug_hooks::finish, go_dump_file, go_output_fndecl(), go_output_typedef(), go_output_var(), go_print_macro(), godump_container::invalid_hash, godump_container::keyword_hash, keyword_hash_init(), macro_hash, pointer_set_create(), pointer_set_destroy(), pointer_set_traverse(), godump_container::pot_dummy_types, queue, string_hash_eq(), godump_container::type_hash, godump_container::type_obstack, and vec_free().
Referenced by dump_go_spec_init().
|
static |
Write the Go version of TYPE to CONTAINER->TYPE_OBSTACK. USE_TYPE_NAME is true if we can simply use a type name here without needing to define it. IS_FUNC_OK is true if we can output a func type here; the "func" keyword will already have been added. Return true if the type can be represented in Go, false otherwise.
References godump_container::decls_seen, go_append_string(), host_integerp(), HOST_WIDE_INT_PRINT_DEC, godump_container::invalid_hash, godump_container::keyword_hash, obstack, pointer_set_contains(), pointer_set_insert(), godump_container::pot_dummy_types, prototype_p(), snprintf(), stdarg_p(), strlen(), tree_int_cst_sgn(), tree_low_cst(), and godump_container::type_obstack.
Referenced by go_output_fndecl(), go_output_typedef(), and go_output_var().
|
static |
A function decl.
References gcc_debug_hooks::function_decl, and go_decl().
Referenced by dump_go_spec_init().
|
static |
A global variable decl.
References gcc_debug_hooks::global_decl, and go_decl().
Referenced by dump_go_spec_init().
|
static |
Output a function declaration.
References go_dump_file, go_format_type(), and go_output_type().
Referenced by go_finish().
|
static |
Output the type which was built on the type obstack, and then free it.
References go_dump_file, obstack, and godump_container::type_obstack.
Referenced by go_output_fndecl(), go_output_typedef(), and go_output_var().
|
static |
Output a typedef or something like a struct definition.
References godump_container::decls_seen, go_dump_file, go_format_type(), go_output_type(), host_integerp(), HOST_WIDE_INT, HOST_WIDE_INT_PRINT_DEC, HOST_WIDE_INT_PRINT_DOUBLE_HEX, HOST_WIDE_INT_PRINT_UNSIGNED, int_size_in_bytes(), godump_container::invalid_hash, macro_hash, macro_hash_del(), macro_hash_value::name, pointer_set_contains(), pointer_set_insert(), snprintf(), tree_low_cst(), type(), godump_container::type_hash, and macro_hash_value::value.
Referenced by go_finish().
|
static |
Output a variable.
References godump_container::decls_seen, go_dump_file, go_format_type(), go_output_type(), pointer_set_contains(), pointer_set_insert(), godump_container::pot_dummy_types, and godump_container::type_hash.
Referenced by go_finish().
|
static |
Output the final value of a preprocessor macro or enum constant. This is called via htab_traverse_noresize.
References go_dump_file, macro_hash_value::name, and macro_hash_value::value.
Referenced by go_finish().
|
static |
A type declaration.
References queue, gcc_debug_hooks::type_decl, and vec_safe_push().
Referenced by dump_go_spec_init().
|
static |
A macro undef.
References macro_hash, macro_hash_value::name, gcc_debug_hooks::undef, and macro_hash_value::value.
Referenced by dump_go_spec_init().
|
static |
References count, godump_container::keyword_hash, and keywords.
Referenced by go_finish().
|
static |
Free values deleted from the macro hash table.
References macro_hash_value::name, and macro_hash_value::value.
Referenced by dump_go_spec_init(), go_define(), and go_output_typedef().
|
static |
Compare values in the macro hash table for equality.
References macro_hash_value::name.
Referenced by dump_go_spec_init().
|
static |
Calculate the hash value for an entry in the macro hash table.
References macro_hash_value::name.
Referenced by dump_go_spec_init().
|
static |
For the string hash tables.
Referenced by go_finish().
|
static |
@verbatim Output Go language descriptions of types.
Copyright (C) 2008-2013 Free Software Foundation, Inc. Written by Ian Lance Taylor iant@. goog le.co m
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
This file is used during the build process to emit Go language descriptions of declarations from C header files. It uses the debug info hooks to emit the descriptions. The Go language descriptions then become part of the Go runtime support library. All global names are output with a leading underscore, so that they are all hidden in Go.
We dump this information from the debug hooks. This gives us a stable and maintainable API to hook into. In order to work correctly when -g is used, we build our own hooks structure which wraps the hooks we need to change.
Our debug hooks. This is initialized by dump_go_spec_init.
Referenced by dump_go_spec_init().
|
static |
The file where we should write information.
Referenced by dump_go_spec_init(), find_dummy_types(), go_define(), go_finish(), go_output_fndecl(), go_output_type(), go_output_typedef(), go_output_var(), and go_print_macro().
|
static |
Build a hash table with the Go keywords.
Referenced by keyword_hash_init().
|
static |
A hash table of macros we have seen.
Referenced by dump_go_spec_init(), go_define(), go_finish(), go_output_typedef(), and go_undef().
A queue of decls to output.
Referenced by build_base_obj_set_for_drs(), collect_bb2reg(), compute_transaction_bits(), discover_iteration_bound_by_body_walk(), dump_node(), eliminate_indirect_cycles(), find_exception_blocks(), fix_bb_placements(), go_decl(), go_finish(), go_type_decl(), graphds_scc(), haifa_find_rgns(), ipa_tm_scan_irr_function(), ipa_tm_transform_calls(), maybe_lower_iteration_bound(), model_recompute(), propagate_dereference_distances(), propagate_pseudo_copies(), queue_and_dump_index(), read_md_rtx(), read_subst_mapping(), rtx_handle_directive(), and tm_region_init().
|
static |
The real debug hooks.