summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-05-02 14:43:35 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-05-02 14:43:35 +0000
commit34efdaf078b01a7387007c4e6bde6db86384c4b7 (patch)
treed503eaf41d085669d1481bb46ec038bc866fece6 /include
parentf733cf303bcdc952c92b81dd62199a40a1f555ec (diff)
downloadgcc-tarball-34efdaf078b01a7387007c4e6bde6db86384c4b7.tar.gz
gcc-7.1.0gcc-7.1.0
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog155
-rw-r--r--include/ansidecl.h40
-rw-r--r--include/demangle.h44
-rw-r--r--include/dwarf2.def75
-rw-r--r--include/dwarf2.h141
-rw-r--r--include/dyn-string.h2
-rw-r--r--include/environ.h2
-rw-r--r--include/fibheap.h2
-rw-r--r--include/filenames.h2
-rw-r--r--include/floatformat.h2
-rw-r--r--include/fnmatch.h2
-rw-r--r--include/gcc-c-fe.def37
-rw-r--r--include/gcc-c-interface.h23
-rw-r--r--include/gcc-cp-fe.def1050
-rw-r--r--include/gcc-cp-interface.h496
-rw-r--r--include/gcc-interface.h111
-rw-r--r--include/gdb/gdb-index.h2
-rw-r--r--include/getopt.h2
-rw-r--r--include/gomp-constants.h8
-rw-r--r--include/hashtab.h2
-rw-r--r--include/hsa.h635
-rw-r--r--include/leb128.h2
-rw-r--r--include/libiberty.h13
-rw-r--r--include/longlong.h31
-rw-r--r--include/lto-symtab.h2
-rw-r--r--include/md5.h2
-rw-r--r--include/objalloc.h2
-rw-r--r--include/obstack.h2
-rw-r--r--include/partition.h2
-rw-r--r--include/plugin-api.h2
-rw-r--r--include/safe-ctype.h2
-rw-r--r--include/sha1.h2
-rw-r--r--include/simple-object.h2
-rw-r--r--include/sort.h2
-rw-r--r--include/splay-tree.h2
-rw-r--r--include/symcat.h2
-rw-r--r--include/timeval-utils.h2
-rw-r--r--include/vtv-change-permission.h2
-rw-r--r--include/xregex2.h2
-rw-r--r--include/xtensa-config.h2
40 files changed, 2775 insertions, 136 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index d8ea905977..28fd2c126d 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,10 +1,150 @@
-2016-08-22 Release Manager
+2017-05-02 Release Manager
- * GCC 6.2.0 released.
+ * GCC 7.1.0 released.
-2016-04-27 Release Manager
+2017-04-04 Jonathan Wakely <jwakely@redhat.com>
- * GCC 6.1.0 released.
+ * ansidecl.h (ATTRIBUTE_PACKED): Fix typo in comment.
+
+2017-02-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/77589
+ * dwarf2.def (DW_OP_GNU_variable_value): New opcode.
+
+2017-01-30 Alexandre Oliva <aoliva@redhat.com>
+
+ Introduce C++ support in libcc1.
+ * gcc-c-fe.def (int_type_v0): Rename from...
+ (int_type): ... this. Introduce new version.
+ (float_type_v0): Rename from...
+ (float_type): ... this. Introduce new version.
+ (char_type): New.
+ * gcc-c-interface.h (gcc_c_api_version): Add GCC_C_FE_VERSION_1.
+ (gcc_type_array): Move...
+ * gcc-interface.h: ... here.
+ * gcc-cp-fe.def: New.
+ * gcc-cp-interface.h: New.
+
+2017-01-30 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gcc-interface.h (enum gcc_base_api_version): Update comment
+ for GCC_FE_VERSION_1.
+ (struct gcc_base_vtable): Rename set_arguments to
+ set_arguments_v0. Add set_arguments, set_triplet_regexp and
+ set_driver_filename.
+
+ * gcc-interface.h (enum gcc_base_api_version): Add comment to
+ GCC_FE_VERSION_1.
+ (struct gcc_base_vtable): Rename compile to compile_v0.
+ Update comment for compile. New methods set_verbose and
+ compile.
+
+ * gcc-interface.h (enum gcc_base_api_version): Add
+ GCC_FE_VERSION_1.
+
+2017-01-24 Pekka Jääskeläinen <pekka@parmance.com>
+ Martin Jambor <mjambor@suse.cz>
+
+ * hsa.h: Moved here from libgomp/plugin/hsa.h.
+
+2017-01-04 Richard Earnshaw <rearnsha@arm.com>
+ Jiong Wang <jiong.wang@arm.com>
+
+ * dwarf2.def (DW_OP_AARCH64_operation): Reserve the number 0xea.
+ (DW_CFA_GNU_window_save): Comments the multiplexing on AArch64.
+
+2017-01-04 Jakub Jelinek <jakub@redhat.com>
+
+ Update copyright years.
+
+2016-12-21 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2.def (DW_FORM_ref_sup): Renamed to ...
+ (DW_FORM_ref_sup4): ... this. New form.
+ (DW_FORM_ref_sup8): New form.
+
+2016-11-03 David Tolnay <dtolnay@gmail.com>
+ Mark Wielaard <mark@klomp.org>
+
+ * demangle.h (DMGL_RUST): New macro.
+ (DMGL_STYLE_MASK): Add DMGL_RUST.
+ (demangling_styles): Add dlang_rust.
+ (RUST_DEMANGLING_STYLE_STRING): New macro.
+ (RUST_DEMANGLING): New macro.
+ (rust_demangle): New prototype.
+ (rust_is_mangled): Likewise.
+ (rust_demangle_sym): Likewise.
+
+2016-11-07 Jason Merrill <jason@redhat.com>
+
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_NOEXCEPT, DEMANGLE_COMPONENT_THROW_SPEC.
+
+2016-10-17 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2.h (enum dwarf_calling_convention): Add new DWARF5
+ calling convention codes.
+ (enum dwarf_line_number_content_type): New.
+ (enum dwarf_location_list_entry_type): Add DWARF5 DW_LLE_*
+ codes.
+ (enum dwarf_source_language): Add new DWARF5 DW_LANG_* codes.
+ (enum dwarf_macro_record_type): Add DWARF5 DW_MACRO_* codes.
+ (enum dwarf_name_index_attribute): New.
+ (enum dwarf_range_list_entry): New.
+ (enum dwarf_unit_type): New.
+ * dwarf2.def: Add new DWARF5 DW_TAG_*, DW_FORM_*, DW_AT_*,
+ DW_OP_* and DW_ATE_* entries.
+
+2016-10-14 Pedro Alves <palves@redhat.com>
+
+ * ansidecl.h [__cplusplus >= 201103 && GCC_VERSION < 4007] (FINAL,
+ OVERRIDE): Define as empty.
+ [__cplusplus < 201103 && GCC_VERSION < 4007] (FINAL): Define as
+ __final.
+ [__cplusplus < 201103 && GCC_VERSION >= 4007] (OVERRIDE): Define as
+ empty.
+
+2016-10-14 Pedro Alves <palves@redhat.com>
+
+ * ansidecl.h (GCC_FINAL): Delete.
+ (OVERRIDE, FINAL): New, moved from gcc/coretypes.h.
+
+2016-08-15 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2.def (DW_AT_string_length_bit_size,
+ DW_AT_string_length_byte_size): New attributes.
+
+2016-08-12 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/63240
+ * dwarf2.def (DW_AT_deleted, DW_AT_defaulted): New.
+ * dwarf2.h (enum dwarf_defaulted_attribute): New.
+
+2016-07-29 Aldy Hernandez <aldyh@redhat.com>
+
+ * libiberty.h (MAX_ALLOCA_SIZE): New macro.
+
+2016-05-26 Chung-Lin Tang <cltang@codesourcery.com>
+
+ * gomp-constants.h (GOMP_VERSION): Increment to 1, add comment to
+ describe the need for incrementing this macro whenever the plugin
+ interface is modified.
+
+2016-04-29 Tom Tromey <tom@tromey.com>
+
+ * dwarf2.h (enum dwarf_source_language) <DW_LANG_Rust,
+ DW_LANG_Rust_old>: New constants.
+
+2016-04-29 Oleg Endo <olegendo@gcc.gnu.org>
+
+ * longlong.h (umul_ppmm): Remove SHMEDIA checks.
+ (__umulsidi3, count_leading_zeros): Remove SHMEDIA implementations.
+
+2016-04-29 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * longlong.h (add_ssaaaa): Replace obsolete 'J' constraint with
+ 'Cal' constraint.
+ (sub_ddmmss): Likewise.
2016-03-17 Thomas Schwinge <thomas@codesourcery.com>
@@ -50,6 +190,13 @@
* libiberty.h (dupargv): Change arg to char * const *.
(writeargv, countargv): Likewise.
+2015-11-27 Pedro Alves <palves@redhat.com>
+
+ PR other/61321
+ PR other/61233
+ * demangle.h (enum demangle_component_type)
+ <DEMANGLE_COMPONENT_CONVERSION>: New value.
+
2015-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* vtv-change-permission.h (VTV_PAGE_SIZE) [__sun__ && __svr4__ &&
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 6e4bfc21f2..25f33dad23 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -1,5 +1,5 @@
/* ANSI and traditional C compatability macros
- Copyright (C) 1991-2015 Free Software Foundation, Inc.
+ Copyright (C) 1991-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@ -252,7 +252,7 @@ So instead we use the macro below and test it against specific values. */
# endif /* GNUC >= 3.0 */
#endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
-/* Useful for structures whose layout must much some binary specification
+/* Useful for structures whose layout must match some binary specification
regardless of the alignment and padding qualities of the compiler. */
#ifndef ATTRIBUTE_PACKED
# define ATTRIBUTE_PACKED __attribute__ ((packed))
@@ -313,13 +313,39 @@ So instead we use the macro below and test it against specific values. */
#define ENUM_BITFIELD(TYPE) unsigned int
#endif
- /* This is used to mark a class or virtual function as final. */
-#if __cplusplus >= 201103L
-#define GCC_FINAL final
+/* C++11 adds the ability to add "override" after an implementation of a
+ virtual function in a subclass, to:
+ (A) document that this is an override of a virtual function
+ (B) allow the compiler to issue a warning if it isn't (e.g. a mismatch
+ of the type signature).
+
+ Similarly, it allows us to add a "final" to indicate that no subclass
+ may subsequently override the vfunc.
+
+ Provide OVERRIDE and FINAL as macros, allowing us to get these benefits
+ when compiling with C++11 support, but without requiring C++11.
+
+ For gcc, use "-std=c++11" to enable C++11 support; gcc 6 onwards enables
+ this by default (actually GNU++14). */
+
+#if __cplusplus >= 201103
+/* C++11 claims to be available: use it. final/override were only
+ implemented in 4.7, though. */
+# if GCC_VERSION < 4007
+# define OVERRIDE
+# define FINAL
+# else
+# define OVERRIDE override
+# define FINAL final
+# endif
#elif GCC_VERSION >= 4007
-#define GCC_FINAL __final
+/* G++ 4.7 supports __final in C++98. */
+# define OVERRIDE
+# define FINAL __final
#else
-#define GCC_FINAL
+/* No C++11 support; leave the macros empty: */
+# define OVERRIDE
+# define FINAL
#endif
#ifdef __cplusplus
diff --git a/include/demangle.h b/include/demangle.h
index 1d7cadf4b7..996203b2d7 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -1,5 +1,5 @@
/* Defs for interface to demanglers.
- Copyright (C) 1992-2015 Free Software Foundation, Inc.
+ Copyright (C) 1992-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License
@@ -63,9 +63,10 @@ extern "C" {
#define DMGL_GNU_V3 (1 << 14)
#define DMGL_GNAT (1 << 15)
#define DMGL_DLANG (1 << 16)
+#define DMGL_RUST (1 << 17) /* Rust wraps GNU_V3 style mangling. */
/* If none of these are set, use 'current_demangling_style' as the default. */
-#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT|DMGL_DLANG)
+#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT|DMGL_DLANG|DMGL_RUST)
/* Enumeration of possible demangling styles.
@@ -88,7 +89,8 @@ extern enum demangling_styles
gnu_v3_demangling = DMGL_GNU_V3,
java_demangling = DMGL_JAVA,
gnat_demangling = DMGL_GNAT,
- dlang_demangling = DMGL_DLANG
+ dlang_demangling = DMGL_DLANG,
+ rust_demangling = DMGL_RUST
} current_demangling_style;
/* Define string names for the various demangling styles. */
@@ -104,6 +106,7 @@ extern enum demangling_styles
#define JAVA_DEMANGLING_STYLE_STRING "java"
#define GNAT_DEMANGLING_STYLE_STRING "gnat"
#define DLANG_DEMANGLING_STYLE_STRING "dlang"
+#define RUST_DEMANGLING_STYLE_STRING "rust"
/* Some macros to test what demangling style is active. */
@@ -118,6 +121,7 @@ extern enum demangling_styles
#define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
#define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
#define DLANG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_DLANG)
+#define RUST_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_RUST)
/* Provide information about the available demangle styles. This code is
pulled from gdb into libiberty because it is useful to binutils also. */
@@ -175,6 +179,27 @@ ada_demangle (const char *mangled, int options);
extern char *
dlang_demangle (const char *mangled, int options);
+/* Returns non-zero iff MANGLED is a rust mangled symbol. MANGLED must
+ already have been demangled through cplus_demangle_v3. If this function
+ returns non-zero then MANGLED can be demangled (in-place) using
+ RUST_DEMANGLE_SYM. */
+extern int
+rust_is_mangled (const char *mangled);
+
+/* Demangles SYM (in-place) if RUST_IS_MANGLED returned non-zero for SYM.
+ If RUST_IS_MANGLED returned zero for SYM then RUST_DEMANGLE_SYM might
+ replace characters that cannot be demangled with '?' and might truncate
+ SYM. After calling RUST_DEMANGLE_SYM SYM might be shorter, but never
+ larger. */
+extern void
+rust_demangle_sym (char *sym);
+
+/* Demangles MANGLED if it was GNU_V3 and then RUST mangled, otherwise
+ returns NULL. Uses CPLUS_DEMANGLE_V3, RUST_IS_MANGLED and
+ RUST_DEMANGLE_SYM. Returns a new string that is owned by the caller. */
+extern char *
+rust_demangle (const char *mangled, int options);
+
enum gnu_v3_ctor_kinds {
gnu_v3_complete_object_ctor = 1,
gnu_v3_base_object_ctor,
@@ -449,7 +474,9 @@ enum demangle_component_type
/* A transaction-safe function type. */
DEMANGLE_COMPONENT_TRANSACTION_SAFE,
/* A cloned function. */
- DEMANGLE_COMPONENT_CLONE
+ DEMANGLE_COMPONENT_CLONE,
+ DEMANGLE_COMPONENT_NOEXCEPT,
+ DEMANGLE_COMPONENT_THROW_SPEC
};
/* Types which are only used internally. */
@@ -467,6 +494,11 @@ struct demangle_component
/* The type of this component. */
enum demangle_component_type type;
+ /* Guard against recursive component printing.
+ Initialize to zero. Private to d_print_comp.
+ All other fields are final after initialization. */
+ int d_printing;
+
union
{
/* For DEMANGLE_COMPONENT_NAME. */
@@ -661,7 +693,7 @@ cplus_demangle_v3_components (const char *mangled, int options, void **mem);
extern char *
cplus_demangle_print (int options,
- const struct demangle_component *tree,
+ struct demangle_component *tree,
int estimated_length,
size_t *p_allocated_size);
@@ -681,7 +713,7 @@ cplus_demangle_print (int options,
extern int
cplus_demangle_print_callback (int options,
- const struct demangle_component *tree,
+ struct demangle_component *tree,
demangle_callbackref callback, void *opaque);
#ifdef __cplusplus
diff --git a/include/dwarf2.def b/include/dwarf2.def
index 2dfee5666d..ea6194ef33 100644
--- a/include/dwarf2.def
+++ b/include/dwarf2.def
@@ -1,7 +1,7 @@
/* -*- c -*-
Declarations and definitions of codes relating to the DWARF2 and
DWARF3 symbolic debugging information formats.
- Copyright (C) 1992-2015 Free Software Foundation, Inc.
+ Copyright (C) 1992-2017 Free Software Foundation, Inc.
Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
Office (AJPO), Florida State University and Silicon Graphics Inc.
@@ -132,7 +132,14 @@ DW_TAG (DW_TAG_type_unit, 0x41)
DW_TAG (DW_TAG_rvalue_reference_type, 0x42)
DW_TAG (DW_TAG_template_alias, 0x43)
/* DWARF 5. */
+DW_TAG (DW_TAG_coarray_type, 0x44)
+DW_TAG (DW_TAG_generic_subrange, 0x45)
+DW_TAG (DW_TAG_dynamic_type, 0x46)
DW_TAG (DW_TAG_atomic_type, 0x47)
+DW_TAG (DW_TAG_call_site, 0x48)
+DW_TAG (DW_TAG_call_site_parameter, 0x49)
+DW_TAG (DW_TAG_skeleton_unit, 0x4a)
+DW_TAG (DW_TAG_immutable_type, 0x4b)
DW_TAG_DUP (DW_TAG_lo_user, 0x4080)
DW_TAG_DUP (DW_TAG_hi_user, 0xffff)
@@ -202,6 +209,17 @@ DW_FORM (DW_FORM_sec_offset, 0x17)
DW_FORM (DW_FORM_exprloc, 0x18)
DW_FORM (DW_FORM_flag_present, 0x19)
DW_FORM (DW_FORM_ref_sig8, 0x20)
+/* DWARF 5. */
+DW_FORM (DW_FORM_strx, 0x1a)
+DW_FORM (DW_FORM_addrx, 0x1b)
+DW_FORM (DW_FORM_ref_sup4, 0x1c)
+DW_FORM (DW_FORM_strp_sup, 0x1d)
+DW_FORM (DW_FORM_data16, 0x1e)
+DW_FORM (DW_FORM_line_strp, 0x1f)
+DW_FORM (DW_FORM_implicit_const, 0x21)
+DW_FORM (DW_FORM_loclistx, 0x22)
+DW_FORM (DW_FORM_rnglistx, 0x23)
+DW_FORM (DW_FORM_ref_sup8, 0x24)
/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
DW_FORM (DW_FORM_GNU_addr_index, 0x1f01)
DW_FORM (DW_FORM_GNU_str_index, 0x1f02)
@@ -309,7 +327,35 @@ DW_AT (DW_AT_const_expr, 0x6c)
DW_AT (DW_AT_enum_class, 0x6d)
DW_AT (DW_AT_linkage_name, 0x6e)
/* DWARF 5. */
+DW_AT (DW_AT_string_length_bit_size, 0x6f)
+DW_AT (DW_AT_string_length_byte_size, 0x70)
+DW_AT (DW_AT_rank, 0x71)
+DW_AT (DW_AT_str_offsets_base, 0x72)
+DW_AT (DW_AT_addr_base, 0x73)
+DW_AT (DW_AT_rnglists_base, 0x74)
+DW_AT (DW_AT_dwo_name, 0x76)
+DW_AT (DW_AT_reference, 0x77)
+DW_AT (DW_AT_rvalue_reference, 0x78)
+DW_AT (DW_AT_macros, 0x79)
+DW_AT (DW_AT_call_all_calls, 0x7a)
+DW_AT (DW_AT_call_all_source_calls, 0x7b)
+DW_AT (DW_AT_call_all_tail_calls, 0x7c)
+DW_AT (DW_AT_call_return_pc, 0x7d)
+DW_AT (DW_AT_call_value, 0x7e)
+DW_AT (DW_AT_call_origin, 0x7f)
+DW_AT (DW_AT_call_parameter, 0x80)
+DW_AT (DW_AT_call_pc, 0x81)
+DW_AT (DW_AT_call_tail_call, 0x82)
+DW_AT (DW_AT_call_target, 0x83)
+DW_AT (DW_AT_call_target_clobbered, 0x84)
+DW_AT (DW_AT_call_data_location, 0x85)
+DW_AT (DW_AT_call_data_value, 0x86)
DW_AT (DW_AT_noreturn, 0x87)
+DW_AT (DW_AT_alignment, 0x88)
+DW_AT (DW_AT_export_symbols, 0x89)
+DW_AT (DW_AT_deleted, 0x8a)
+DW_AT (DW_AT_defaulted, 0x8b)
+DW_AT (DW_AT_loclists_base, 0x8c)
DW_AT_DUP (DW_AT_lo_user, 0x2000) /* Implementation-defined range start. */
DW_AT_DUP (DW_AT_hi_user, 0x3fff) /* Implementation-defined range end. */
@@ -591,6 +637,18 @@ DW_OP (DW_OP_bit_piece, 0x9d)
DW_OP (DW_OP_implicit_value, 0x9e)
DW_OP (DW_OP_stack_value, 0x9f)
+/* DWARF 5 extensions. */
+DW_OP (DW_OP_implicit_pointer, 0xa0)
+DW_OP (DW_OP_addrx, 0xa1)
+DW_OP (DW_OP_constx, 0xa2)
+DW_OP (DW_OP_entry_value, 0xa3)
+DW_OP (DW_OP_const_type, 0xa4)
+DW_OP (DW_OP_regval_type, 0xa5)
+DW_OP (DW_OP_deref_type, 0xa6)
+DW_OP (DW_OP_xderef_type, 0xa7)
+DW_OP (DW_OP_convert, 0xa8)
+DW_OP (DW_OP_reinterpret, 0xa9)
+
DW_OP_DUP (DW_OP_lo_user, 0xe0) /* Implementation-defined range start. */
DW_OP_DUP (DW_OP_hi_user, 0xff) /* Implementation-defined range end. */
@@ -617,6 +675,9 @@ DW_OP (DW_OP_GNU_parameter_ref, 0xfa)
/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
DW_OP (DW_OP_GNU_addr_index, 0xfb)
DW_OP (DW_OP_GNU_const_index, 0xfc)
+/* The GNU variable value extension.
+ See http://dwarfstd.org/ShowIssue.php?issue=161109.2 . */
+DW_OP (DW_OP_GNU_variable_value, 0xfd)
/* HP extensions. */
DW_OP_DUP (DW_OP_HP_unknown, 0xe0) /* Ouch, the same as GNU_push_tls_address. */
DW_OP (DW_OP_HP_is_value, 0xe1)
@@ -627,6 +688,12 @@ DW_OP (DW_OP_HP_unmod_range, 0xe5)
DW_OP (DW_OP_HP_tls, 0xe6)
/* PGI (STMicroelectronics) extensions. */
DW_OP (DW_OP_PGI_omp_thread_num, 0xf8)
+/* AARCH64 extensions.
+ DW_OP_AARCH64_operation takes one mandatory unsigned LEB128 operand.
+ Bits[6:0] of this operand is the action code, all others bits are initialized
+ to 0 except explicitly documented for one action. Please refer AArch64 DWARF
+ ABI documentation for details. */
+DW_OP (DW_OP_AARCH64_operation, 0xea)
DW_END_OP
DW_FIRST_ATE (DW_ATE_void, 0x0)
@@ -648,6 +715,9 @@ DW_ATE (DW_ATE_unsigned_fixed, 0xe)
DW_ATE (DW_ATE_decimal_float, 0xf)
/* DWARF 4. */
DW_ATE (DW_ATE_UTF, 0x10)
+/* DWARF 5. */
+DW_ATE (DW_ATE_UCS, 0x11)
+DW_ATE (DW_ATE_ASCII, 0x12)
DW_ATE_DUP (DW_ATE_lo_user, 0x80)
DW_ATE_DUP (DW_ATE_hi_user, 0xff)
@@ -705,7 +775,8 @@ DW_CFA (DW_CFA_hi_user, 0x3f)
/* SGI/MIPS specific. */
DW_CFA (DW_CFA_MIPS_advance_loc8, 0x1d)
-/* GNU extensions. */
+/* GNU extensions.
+ NOTE: DW_CFA_GNU_window_save is multiplexed on Sparc and AArch64. */
DW_CFA (DW_CFA_GNU_window_save, 0x2d)
DW_CFA (DW_CFA_GNU_args_size, 0x2e)
DW_CFA (DW_CFA_GNU_negative_offset_extended, 0x2f)
diff --git a/include/dwarf2.h b/include/dwarf2.h
index 4ada87162f..9c788803e4 100644
--- a/include/dwarf2.h
+++ b/include/dwarf2.h
@@ -1,6 +1,6 @@
/* Declarations and definitions of codes relating to the DWARF2 and
DWARF3 symbolic debugging information formats.
- Copyright (C) 1992-2015 Free Software Foundation, Inc.
+ Copyright (C) 1992-2017 Free Software Foundation, Inc.
Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
Office (AJPO), Florida State University and Silicon Graphics Inc.
@@ -175,6 +175,10 @@ enum dwarf_calling_convention
DW_CC_program = 0x2,
DW_CC_nocall = 0x3,
+ /* DWARF 5. */
+ DW_CC_pass_by_reference = 0x4,
+ DW_CC_pass_by_value = 0x5,
+
DW_CC_lo_user = 0x40,
DW_CC_hi_user = 0xff,
@@ -257,15 +261,38 @@ enum dwarf_line_number_hp_sfc_ops
DW_LNE_HP_SFC_associate = 3
};
-/* Type codes for location list entries.
- Extension for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
+/* Content type codes in line table directory_entry_format
+ and file_name_entry_format sequences. */
+enum dwarf_line_number_content_type
+ {
+ DW_LNCT_path = 0x1,
+ DW_LNCT_directory_index = 0x2,
+ DW_LNCT_timestamp = 0x3,
+ DW_LNCT_size = 0x4,
+ DW_LNCT_MD5 = 0x5,
+ DW_LNCT_lo_user = 0x2000,
+ DW_LNCT_hi_user = 0x3fff
+ };
+/* Type codes for location list entries. */
enum dwarf_location_list_entry_type
{
- DW_LLE_GNU_end_of_list_entry = 0,
- DW_LLE_GNU_base_address_selection_entry = 1,
- DW_LLE_GNU_start_end_entry = 2,
- DW_LLE_GNU_start_length_entry = 3
+ DW_LLE_end_of_list = 0x00,
+ DW_LLE_base_addressx = 0x01,
+ DW_LLE_startx_endx = 0x02,
+ DW_LLE_startx_length = 0x03,
+ DW_LLE_offset_pair = 0x04,
+ DW_LLE_default_location = 0x05,
+ DW_LLE_base_address = 0x06,
+ DW_LLE_start_end = 0x07,
+ DW_LLE_start_length = 0x08,
+
+ /* Former extension for Fission.
+ See http://gcc.gnu.org/wiki/DebugFission. */
+ DW_LLE_GNU_end_of_list_entry = 0x00,
+ DW_LLE_GNU_base_address_selection_entry = 0x01,
+ DW_LLE_GNU_start_end_entry = 0x02,
+ DW_LLE_GNU_start_length_entry = 0x03
};
#define DW_CIE_ID 0xffffffff
@@ -305,13 +332,22 @@ enum dwarf_source_language
/* DWARF 4. */
DW_LANG_Python = 0x0014,
/* DWARF 5. */
+ DW_LANG_OpenCL = 0x0015,
DW_LANG_Go = 0x0016,
-
- DW_LANG_C_plus_plus_11 = 0x001a, /* dwarf5.20141029.pdf DRAFT */
+ DW_LANG_Modula3 = 0x0017,
+ DW_LANG_Haskell = 0x0018,
+ DW_LANG_C_plus_plus_03 = 0x0019,
+ DW_LANG_C_plus_plus_11 = 0x001a,
+ DW_LANG_OCaml = 0x001b,
+ DW_LANG_Rust = 0x001c,
DW_LANG_C11 = 0x001d,
+ DW_LANG_Swift = 0x001e,
+ DW_LANG_Julia = 0x001f,
+ DW_LANG_Dylan = 0x0020,
DW_LANG_C_plus_plus_14 = 0x0021,
DW_LANG_Fortran03 = 0x0022,
DW_LANG_Fortran08 = 0x0023,
+ DW_LANG_RenderScript = 0x0024,
DW_LANG_lo_user = 0x8000, /* Implementation-defined range start. */
DW_LANG_hi_user = 0xffff, /* Implementation-defined range start. */
@@ -325,7 +361,10 @@ enum dwarf_source_language
DW_LANG_HP_Basic91 = 0x8004,
DW_LANG_HP_Pascal91 = 0x8005,
DW_LANG_HP_IMacro = 0x8006,
- DW_LANG_HP_Assembler = 0x8007
+ DW_LANG_HP_Assembler = 0x8007,
+
+ /* Rust extension, but replaced in DWARF 5. */
+ DW_LANG_Rust_old = 0x9000
};
/* Names and codes for macro information. */
@@ -338,24 +377,86 @@ enum dwarf_macinfo_record_type
DW_MACINFO_vendor_ext = 255
};
+/* DW_TAG_defaulted/DW_TAG_GNU_defaulted attributes. */
+enum dwarf_defaulted_attribute
+ {
+ DW_DEFAULTED_no = 0x00,
+ DW_DEFAULTED_in_class = 0x01,
+ DW_DEFAULTED_out_of_class = 0x02
+ };
+
/* Names and codes for new style macro information. */
enum dwarf_macro_record_type
{
- DW_MACRO_GNU_define = 1,
- DW_MACRO_GNU_undef = 2,
- DW_MACRO_GNU_start_file = 3,
- DW_MACRO_GNU_end_file = 4,
- DW_MACRO_GNU_define_indirect = 5,
- DW_MACRO_GNU_undef_indirect = 6,
- DW_MACRO_GNU_transparent_include = 7,
+ DW_MACRO_define = 0x01,
+ DW_MACRO_undef = 0x02,
+ DW_MACRO_start_file = 0x03,
+ DW_MACRO_end_file = 0x04,
+ DW_MACRO_define_strp = 0x05,
+ DW_MACRO_undef_strp = 0x06,
+ DW_MACRO_import = 0x07,
+ DW_MACRO_define_sup = 0x08,
+ DW_MACRO_undef_sup = 0x09,
+ DW_MACRO_import_sup = 0x0a,
+ DW_MACRO_define_strx = 0x0b,
+ DW_MACRO_undef_strx = 0x0c,
+ DW_MACRO_lo_user = 0xe0,
+ DW_MACRO_hi_user = 0xff,
+
+ /* Compatibility macros for the GNU .debug_macro extension. */
+ DW_MACRO_GNU_define = 0x01,
+ DW_MACRO_GNU_undef = 0x02,
+ DW_MACRO_GNU_start_file = 0x03,
+ DW_MACRO_GNU_end_file = 0x04,
+ DW_MACRO_GNU_define_indirect = 0x05,
+ DW_MACRO_GNU_undef_indirect = 0x06,
+ DW_MACRO_GNU_transparent_include = 0x07,
/* Extensions for DWZ multifile.
See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open . */
- DW_MACRO_GNU_define_indirect_alt = 8,
- DW_MACRO_GNU_undef_indirect_alt = 9,
- DW_MACRO_GNU_transparent_include_alt = 10,
+ DW_MACRO_GNU_define_indirect_alt = 0x08,
+ DW_MACRO_GNU_undef_indirect_alt = 0x09,
+ DW_MACRO_GNU_transparent_include_alt = 0x0a,
DW_MACRO_GNU_lo_user = 0xe0,
DW_MACRO_GNU_hi_user = 0xff
};
+
+/* Index attributes in the Abbreviations Table. */
+enum dwarf_name_index_attribute
+ {
+ DW_IDX_compile_unit = 1,
+ DW_IDX_type_unit = 2,
+ DW_IDX_die_offset = 3,
+ DW_IDX_parent = 4,
+ DW_IDX_type_hash = 5,
+ DW_IDX_lo_user = 0x2000,
+ DW_IDX_hi_user = 0x3fff
+ };
+
+/* Range list entry kinds in .debug_rnglists* section. */
+enum dwarf_range_list_entry
+ {
+ DW_RLE_end_of_list = 0x00,
+ DW_RLE_base_addressx = 0x01,
+ DW_RLE_startx_endx = 0x02,
+ DW_RLE_startx_length = 0x03,
+ DW_RLE_offset_pair = 0x04,
+ DW_RLE_base_address = 0x05,
+ DW_RLE_start_end = 0x06,
+ DW_RLE_start_length = 0x07
+ };
+
+/* Unit types in unit_type unit header field. */
+enum dwarf_unit_type
+ {
+ DW_UT_compile = 0x01,
+ DW_UT_type = 0x02,
+ DW_UT_partial = 0x03,
+ DW_UT_skeleton = 0x04,
+ DW_UT_split_compile = 0x05,
+ DW_UT_split_type = 0x06,
+ DW_UT_lo_user = 0x80,
+ DW_UT_hi_user = 0xff
+ };
/* @@@ For use with GNU frame unwind information. */
diff --git a/include/dyn-string.h b/include/dyn-string.h
index 7c3684b7cf..6c0accc724 100644
--- a/include/dyn-string.h
+++ b/include/dyn-string.h
@@ -1,5 +1,5 @@
/* An abstract string datatype.
- Copyright (C) 1998-2015 Free Software Foundation, Inc.
+ Copyright (C) 1998-2017 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GCC.
diff --git a/include/environ.h b/include/environ.h
index c18902ba5b..326a27812d 100644
--- a/include/environ.h
+++ b/include/environ.h
@@ -1,5 +1,5 @@
/* Declare the environ system variable.
- Copyright (C) 2015 Free Software Foundation, Inc.
+ Copyright (C) 2015-2017 Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
diff --git a/include/fibheap.h b/include/fibheap.h
index 85b10c58b6..c27842290e 100644
--- a/include/fibheap.h
+++ b/include/fibheap.h
@@ -1,5 +1,5 @@
/* A Fibonacci heap datatype.
- Copyright (C) 1998-2015 Free Software Foundation, Inc.
+ Copyright (C) 1998-2017 Free Software Foundation, Inc.
Contributed by Daniel Berlin (dan@cgsoftware.com).
This file is part of GCC.
diff --git a/include/filenames.h b/include/filenames.h
index 1161daaa4f..5a2a0552e4 100644
--- a/include/filenames.h
+++ b/include/filenames.h
@@ -5,7 +5,7 @@
use forward- and back-slash in path names interchangeably, and
some of them have case-insensitive file names.
- Copyright (C) 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 2000-2017 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
diff --git a/include/floatformat.h b/include/floatformat.h
index af4d09cb86..8869715bba 100644
--- a/include/floatformat.h
+++ b/include/floatformat.h
@@ -1,5 +1,5 @@
/* IEEE floating point support declarations, for GDB, the GNU Debugger.
- Copyright (C) 1991-2015 Free Software Foundation, Inc.
+ Copyright (C) 1991-2017 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/include/fnmatch.h b/include/fnmatch.h
index 0789fc1469..d969758fe5 100644
--- a/include/fnmatch.h
+++ b/include/fnmatch.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
diff --git a/include/gcc-c-fe.def b/include/gcc-c-fe.def
index 25ace1c852..acf1940c01 100644
--- a/include/gcc-c-fe.def
+++ b/include/gcc-c-fe.def
@@ -1,6 +1,6 @@
/* Interface between GCC C FE and GDB -*- c -*-
- Copyright (C) 2014-2015 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This file is part of GCC.
@@ -125,16 +125,18 @@ GCC_METHOD3 (gcc_type, build_function_type,
const struct gcc_type_array *, /* Argument ARGUMENT_TYPES. */
int /* bool */) /* Argument IS_VARARGS. */
-/* Return an integer type with the given properties. */
+/* Return an integer type with the given properties.
+ Deprecated in v1, use int_type instead. */
-GCC_METHOD2 (gcc_type, int_type,
+GCC_METHOD2 (gcc_type, int_type_v0,
int /* bool */, /* Argument IS_UNSIGNED. */
unsigned long) /* Argument SIZE_IN_BYTES. */
-/* Return a floating point type with the given properties. */
+/* Return a floating point type with the given properties.
+ Deprecated in v1, use float_type instead. */
-GCC_METHOD1 (gcc_type, float_type,
- unsigned long) /* Argument SIZE_IN_BYTES. */
+GCC_METHOD1 (gcc_type, float_type_v0,
+ unsigned long) /* Argument SIZE_IN_BYTES. */
/* Return the 'void' type. */
@@ -195,3 +197,26 @@ GCC_METHOD5 (int /* bool */, build_constant,
GCC_METHOD1 (gcc_type, error,
const char *) /* Argument MESSAGE. */
+
+/* Return an integer type with the given properties. If BUILTIN_NAME
+ is non-NULL, it must name a builtin integral type with the given
+ signedness and size, and that is the type that will be returned. */
+
+GCC_METHOD3 (gcc_type, int_type,
+ int /* bool */, /* Argument IS_UNSIGNED. */
+ unsigned long, /* Argument SIZE_IN_BYTES. */
+ const char *) /* Argument BUILTIN_NAME. */
+
+/* Return the 'char' type, a distinct type from both 'signed char' and
+ 'unsigned char' returned by int_type. */
+
+GCC_METHOD0 (gcc_type, char_type)
+
+/* Return a floating point type with the given properties. If BUILTIN_NAME
+ is non-NULL, it must name a builtin integral type with the given
+ signedness and size, and that is the type that will be returned. */
+
+GCC_METHOD2 (gcc_type, float_type,
+ unsigned long, /* Argument SIZE_IN_BYTES. */
+ const char *) /* Argument BUILTIN_NAME. */
+
diff --git a/include/gcc-c-interface.h b/include/gcc-c-interface.h
index 95d0fc94e5..e048c86307 100644
--- a/include/gcc-c-interface.h
+++ b/include/gcc-c-interface.h
@@ -1,6 +1,6 @@
/* Interface between GCC C FE and GDB
- Copyright (C) 2014-2015 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This file is part of GCC.
@@ -41,7 +41,11 @@ struct gcc_c_context;
enum gcc_c_api_version
{
- GCC_C_FE_VERSION_0 = 0
+ GCC_C_FE_VERSION_0 = 0,
+
+ /* Added char_type. Added new version of int_type and float_type,
+ deprecated int_type_v0 and float_type_v0. */
+ GCC_C_FE_VERSION_1 = 1
};
/* Qualifiers. */
@@ -111,19 +115,6 @@ typedef gcc_address gcc_c_symbol_address_function (void *datum,
struct gcc_c_context *ctxt,
const char *identifier);
-/* An array of types used for creating a function type. */
-
-struct gcc_type_array
-{
- /* Number of elements. */
-
- int n_elements;
-
- /* The elements. */
-
- gcc_type *elements;
-};
-
/* The vtable used by the C front end. */
struct gcc_c_fe_vtable
@@ -146,7 +137,7 @@ struct gcc_c_fe_vtable
provides the declaration.
DATUM is an arbitrary piece of data that is passed back verbatim
- to the callbakcs in requests. */
+ to the callbacks in requests. */
void (*set_callbacks) (struct gcc_c_context *self,
gcc_c_oracle_function *binding_oracle,
diff --git a/include/gcc-cp-fe.def b/include/gcc-cp-fe.def
new file mode 100644
index 0000000000..c367c1db1e
--- /dev/null
+++ b/include/gcc-cp-fe.def
@@ -0,0 +1,1050 @@
+/* Interface between GCC C++ FE and GDB -*- c -*-
+
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ This program 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 of the License, or
+ (at your option) any later version.
+
+ This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
+
+
+
+/* Push namespace NAME as the current binding level, to which
+ newly-introduced decls will be bound. An empty string identifies
+ the global namespace, whereas NULL identifies an anonymous
+ namespace. A namespace named NAME is created in the current scope,
+ if needed.
+
+ If the newly-created namespace is to be an inline namespace, see
+ make_namespace_inline. */
+
+GCC_METHOD1 (int /* bool */, push_namespace,
+ const char *) /* Argument NAME. */
+
+/* Push TYPE as the current binding level, making its members visible
+ for name lookup. The current scope before the call must be the
+ scope in which the class was declared. This should be used if the
+ definition of a class is already finished, but one wishes to define
+ a nested class, or to enter the scope of one of its member
+ functions. */
+
+GCC_METHOD1 (int /* bool */, push_class,
+ gcc_type) /* Argument TYPE. */
+
+/* Push FUNCTION_DECL as the current (empty) binding level (see
+ reactivate_decl). The current enclosing scope before the call must
+ be the scope in which the function was declared. */
+
+GCC_METHOD1 (int /* bool */, push_function,
+ gcc_decl) /* Argument FUNCTION_DECL. */
+
+/* Make DECL visible (again?) within SCOPE. When SCOPE is NULL, it
+ means the current scope; if it is not NULL, it must name a function
+ that is currently active, even if not at the top of the binding
+ chain.
+
+ This function can be used to make e.g. a global function or
+ variable visible in a namespace or local scope (overriding another
+ enclosing definition of the same name), but its most common
+ expected use of this primitive, that gives it its name, is to make
+ declarations visible again after reentering a function scope,
+ because when a function is entered with push_function, that does
+ NOT make any of the declarations nested in it visible for name
+ lookup.
+
+ There is a reason/excuse for that: unlike namespaces and classes,
+ G++ doesn't ever have to reenter function scopes, so its name
+ resolution infrastructure is not prepared to do that. But wait,
+ there is also a good use for this apparent limitation: a function
+ may contain multiple scopes (blocks), and the name may be bound to
+ different symbols in each of these scopes. With this interface, as
+ we reenter a function scope, we may choose which symbols to make
+ visible for the code snippet, or, if there could be template
+ functions in local scopes, for unresolved names in nested template
+ class default arguments, or in nested template function signatures.
+
+ As for making a local declaration visible for the code snippet,
+ there are two possibilities: a) introduce it upfront, while
+ entering the scope for the user expression (see the enter_scope
+ callback, called by g++ when encountering the push_user_expression
+ pragma), which might save some scope switching and reactivate_decl
+ (though this can't be helped if some declarations have to be
+ introduced and discarded, because of multiple definitions of the
+ same name in different scopes within a function: they have to be
+ defined in discriminator order); or b) introduce it when its name
+ is looked up, entering the scope, introducing the declaration,
+ leaving the scope, and then reactivating the declaration in its
+ local scope.
+
+ Here's some more detail on how reactivate_decl works. Say there's
+ a function foo whose body looks like this:
+
+ {
+ {
+// point 1
+ class c {} o __attribute__ ((__used__)); // c , o
+ }
+ struct c {
+ void f() {
+// point 2
+ }
+ } o __attribute__ ((__used__)); // c_0, o_0
+ {
+ class c {} p __attribute__ ((__used__)); // c_1, p
+// point 3
+ o.f();
+ }
+ }
+
+ When we are about to define class c at point 1, we enter the
+ function foo scope, and since no symbols are visible at point 1, we
+ proceed to declare class c. We may then define the class right
+ away, or, if we leave the function scope, and we later wish to
+ define it, or to define object o, we can reenter the scope and just
+ use the previously-obtained gcc_decl to define the class, without
+ having to reactivate the declaration.
+
+ Now, if we are to set up the binding context for point 2, we have
+ to define c_0::f, and in order to do so, we have to declare and
+ define c_0. Before we can declare c_0, we MUST at least declare c.
+
+ As a general rule, before we can declare or define any local name
+ with a discriminator, we have to at least declare any other
+ occurrences of the same name in the same enclosing entity with
+ lower or absent discriminator.
+
+ So, we declare c, then we leave the function scope and reenter it
+ so as to declare c_0 (also with name "c", which is why we have to
+ leave and reenter the function scope, otherwise we would get an
+ error because of the duplicate definition; g++ will assign a
+ discriminator because it still remembers there was an earlier
+ declaration of c_0 within the function, it's just no longer in
+ scope), then we can define c_0, including its member function f.
+
+ Likewise, if we wish to define o_0, we have to define o first. If
+ we wish to declare (and maybe then define) c_1, we have to at least
+ declare (c and then) c_0 first.
+
+ Then, as we set up the binding context to compile a code snippet at
+ point 3, we may choose to activate c_1, o_0 and p upfront,
+ declaring and discarding c, c_0 and o, and then reentering the
+ funciton scope to declare c_1, o_0 and p; or we can wait for oracle
+ lookups of c, o or p. If c is looked up, and the debugger resolves
+ c in the scope to c_1, it is expected to enter the function scope
+ from the top level, declare c, leave it, reenter it, declare c_0,
+ leave it, reenter it, declare c_1, leave it, and then reactivate
+ c_1 in the function scope. If c_1 is needed as a complete type,
+ the definition may be given right after the declaration, or the
+ scope will have to be reentered in order to define the class.
+
+. If the code snippet is at point 2, we don't need to (re)activate
+ any declaration: nothing from any local scope is visible. Just
+ entering the scope of the class containing member function f
+ reactivates the names of its members, including the class name
+ itself. */
+
+GCC_METHOD2 (int /* bool */, reactivate_decl,
+ gcc_decl, /* Argument DECL. */
+ gcc_decl) /* Argument SCOPE. */
+
+/* Pop the namespace last entered with push_namespace, or class last
+ entered with push_class, or function last entered with
+ push_function, restoring the binding level in effect before the
+ matching push_* call. */
+
+GCC_METHOD0 (int /* bool */, pop_binding_level)
+
+/* Return the NAMESPACE_DECL, TYPE_DECL or FUNCTION_DECL of the
+ binding level that would be popped by pop_scope. */
+
+GCC_METHOD0 (gcc_decl, get_current_binding_level_decl)
+
+/* Make the current binding level an inline namespace. It must be a
+ namespace to begin with. It is safe to call this more than once
+ for the same namespace, but after the first call, subsequent ones
+ will not return a success status. */
+
+GCC_METHOD0 (int /* bool */, make_namespace_inline)
+
+/* Add USED_NS to the namespaces used by the current binding level.
+ Use get_current_binding_level_decl to obtain USED_NS's
+ gcc_decl. */
+
+GCC_METHOD1 (int /* bool */, add_using_namespace,
+ gcc_decl) /* Argument USED_NS. */
+
+/* Introduce a namespace alias declaration, as in:
+
+ namespace foo = [... ::] bar;
+
+ After this call, namespace TARGET will be visible as ALIAS within
+ the current namespace. Get the declaration for TARGET by calling
+ get_current_binding_level_decl after pushing into it. */
+
+GCC_METHOD2 (int /* bool */, add_namespace_alias,
+ const char *, /* Argument ALIAS. */
+ gcc_decl) /* Argument TARGET. */
+
+/* Introduce a using declaration, as in:
+
+ using foo::bar;
+
+ The TARGET decl names the qualifying scope (foo:: above) and the
+ identifier (bar), but that does not mean that only TARGET will be
+ brought into the current scope: all bindings of TARGET's identifier
+ in the qualifying scope will be brought in.
+
+ FLAGS should specify GCC_CP_SYMBOL_USING. If the current scope is
+ a class scope, visibility flags must be supplied.
+
+ Even when TARGET is template dependent, we don't need to specify
+ whether or not it is a typename: the supplied declaration (that
+ could be a template-dependent type converted to declaration by
+ get_type_decl) indicates so. */
+
+GCC_METHOD2 (int /* bool */, add_using_decl,
+ enum gcc_cp_symbol_kind, /* Argument FLAGS. */
+ gcc_decl) /* Argument TARGET. */
+
+/* Create a new "decl" in GCC, and bind it in the current binding
+ level. A decl is a declaration, basically a kind of symbol.
+
+ NAME is the name of the new symbol. SYM_KIND is the kind of
+ symbol being requested. SYM_TYPE is the new symbol's C++ type;
+ except for labels, where this is not meaningful and should be
+ zero. If SUBSTITUTION_NAME is not NULL, then a reference to this
+ decl in the source will later be substituted with a dereference
+ of a variable of the given name. Otherwise, for symbols having
+ an address (e.g., functions), ADDRESS is the address. FILENAME
+ and LINE_NUMBER refer to the symbol's source location. If this
+ is not known, FILENAME can be NULL and LINE_NUMBER can be 0.
+ This function returns the new decl.
+
+ Use this function to register typedefs, functions and variables to
+ namespace and local binding levels, and typedefs, member functions
+ (static or not), and static data members to class binding levels.
+ Class members must have their access controls specified with
+ GCC_CP_ACCESS_* flags in SYM_KIND.
+
+ Note that, since access controls are disabled, we have no means to
+ express private, protected and public.
+
+ There are various flags that can be set in SYM_KIND to specify
+ additional semantics. Look for GCC_CP_FLAGs in the definition of
+ enum gcc_cp_symbol_kind in gcc-cp-interface.h.
+
+ In order to define member functions, pass GCC_CP_SYMBOL_FUNCTION in
+ SYM_KIND, and a function_type for static member functions or a
+ method type for non-static member functions, including constructors
+ and destructors. Use build_function_type to create a function
+ type; for a method type, start by creating a function type without
+ any compiler-introduced artificial arguments (the implicit this
+ pointer, and the __in_chrg added to constructors and destructors,
+ and __vtt_parm added to the former), and then use build_method_type
+ to create the method type out of the class type and the function
+ type.
+
+ For operator functions, set GCC_CP_FLAG_SPECIAL_FUNCTION in
+ SYM_KIND, in addition to any other applicable flags, and pass as
+ NAME a string starting with the two-character mangling for operator
+ name: "ps" for unary plus, "mL" for multiply and assign, *=; etc.
+ Use "cv" for type converstion operators (the target type portion
+ may be omitted, as it is taken from the return type in SYM_TYPE).
+ For operator"", use "li" followed by the identifier (the mangled
+ name mandates digits specifying the length of the identifier; if
+ present, they determine the end of the identifier, otherwise, the
+ identifier extents to the end of the string, so that "li3_Kme" and
+ "li_Km" are equivalent).
+
+ Constructors and destructors need special care, because for each
+ constructor and destructor there may be multiple clones defined
+ internally by the compiler. With build_decl, you can introduce the
+ base declaration of a constructor or a destructor, setting
+ GCC_CP_FLAG_SPECIAL_FUNCTION the flag and using names starting with
+ capital "C" or "D", respectively, followed by a digit (see below),
+ a blank, or NUL ('\0'). DO NOT supply an ADDRESS or a
+ SUBSTITUTION_NAME to build_decl, it would be meaningless (and
+ rejected) for the base declaration; use define_cdtor_clone to
+ introduce the address of each clone. For constructor templates,
+ declare the template with build_decl, and then, for each
+ specialization, introduce it with
+ build_function_template_specialization, and then define the
+ addresses of each of its clones with define_cdtor_clone.
+
+ NAMEs for GCC_CP_FLAG_SPECIAL_FUNCTION:
+
+ NAME meaning
+ C? constructor base declaration (? may be 1, 2, 4, blank or NUL)
+ D? destructor base declaration (? may be 0, 1, 2, 4, blank or NUL)
+ nw operator new
+ na operator new[]
+ dl operator delete
+ da operator delete[]
+ ps operator + (unary)
+ ng operator - (unary)
+ ad operator & (unary)
+ de operator * (unary)
+ co operator ~
+ pl operator +
+ mi operator -
+ ml operator *
+ dv operator /
+ rm operator %
+ an operator &
+ or operator |
+ eo operator ^
+ aS operator =
+ pL operator +=
+ mI operator -=
+ mL operator *=
+ dV operator /=
+ rM operator %=
+ aN operator &=
+ oR operator |=
+ eO operator ^=
+ ls operator <<
+ rs operator >>
+ lS operator <<=
+ rS operator >>=
+ eq operator ==
+ ne operator !=
+ lt operator <
+ gt operator >
+ le operator <=
+ ge operator >=
+ nt operator !
+ aa operator &&
+ oo operator ||
+ pp operator ++
+ mm operator --
+ cm operator ,
+ pm operator ->*
+ pt operator ->
+ cl operator ()
+ ix operator []
+ qu operator ?
+ cv operator <T> (conversion operator)
+ li<id> operator "" <id>
+
+ FIXME: How about attributes? */
+
+GCC_METHOD7 (gcc_decl, build_decl,
+ const char *, /* Argument NAME. */
+ enum gcc_cp_symbol_kind, /* Argument SYM_KIND. */
+ gcc_type, /* Argument SYM_TYPE. */
+ const char *, /* Argument SUBSTITUTION_NAME. */
+ gcc_address, /* Argument ADDRESS. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Supply the ADDRESS of one of the multiple clones of constructor or
+ destructor CDTOR. The clone is specified by NAME, using the
+ following name mangling conventions:
+
+ C1 in-charge constructor
+ C2 not-in-charge constructor
+ C4 unified constructor
+ D0 deleting destructor
+ D1 in-charge destructor
+ D2 not-in-charge destructor
+ D4 unified destructor
+
+ The following information is not necessary to use the API.
+
+ C1 initializes an instance of the class (rather than of derived
+ classes), including virtual base classes, whereas C2 initializes a
+ sub-object (of the given class type) of an instance of some derived
+ class (or a full object that doesn't have any virtual base
+ classes).
+
+ D0 and D1 destruct an instance of the class, including virtual base
+ classes, but only the former calls operator delete to release the
+ object's storage at the end; D2 destructs a sub-object (of the
+ given class type) of an instance of a derived class (or a full
+ object that doesn't have any virtual base classes).
+
+ The [CD]4 manglings (and symbol definitions) are non-standard, but
+ GCC uses them in some cases: rather than assuming they are
+ in-charge or not-in-charge, they test the implicit argument that
+ the others ignore to tell how to behave. These are used instead of
+ cloning when we just can't use aliases. */
+
+GCC_METHOD3 (gcc_decl, define_cdtor_clone,
+ const char *, /* Argument NAME. */
+ gcc_decl, /* Argument CDTOR. */
+ gcc_address) /* Argument ADDRESS. */
+
+/* Return the type associated with the given declaration. This is
+ most useful to obtain the type associated with a forward-declared
+ class, because it is the gcc_type, rather than the gcc_decl, that
+ has to be used to build other types, but build_decl returns a
+ gcc_decl rather than a gcc_type. This call can in theory be used
+ to obtain the type from any other declaration; it is supposed to
+ return the same type that was supplied when the declaration was
+ created. */
+
+GCC_METHOD1 (gcc_type, get_decl_type,
+ gcc_decl) /* Argument DECL. */
+
+/* Return the declaration for a type. */
+
+GCC_METHOD1 (gcc_decl, get_type_decl,
+ gcc_type) /* Argument TYPE. */
+
+/* Declare DECL as a friend of the current class scope, if TYPE is
+ NULL, or of TYPE itself otherwise. DECL may be a function or a
+ class, be they template generics, template specializations or not
+ templates. TYPE must be a class type (not a template generic).
+
+ The add_friend call cannot introduce a declaration; even if the
+ friend is first declared as a friend in the source code, the
+ declaration belongs in the enclosing namespace, so it must be
+ introduced in that namespace, and the resulting declaration can
+ then be made a friend.
+
+ DECL cannot, however, be a member of a template class generic,
+ because we have no means to introduce their declarations. This
+ interface has no notion of definitions for template generics. As a
+ consequence, users of this interface must introduce each friend
+ template member specialization separately, i.e., instead of:
+
+ template <typename T> friend struct X<T>::M;
+
+ they must be declared as if they were:
+
+ friend struct X<onetype>::M;
+ friend struct X<anothertype>::M;
+ ... for each specialization of X.
+
+
+ Specializations of a template can have each others' members as
+ friends:
+
+ template <typename T> class foo {
+ int f();
+ template <typename U> friend int foo<U>::f();
+ };
+
+ It wouldn't always be possible to define all specializations of a
+ template class before introducing the friend declarations in their
+ expanded, per-specialization form.
+
+ In order to simplify such friend declarations, and to enable
+ incremental friend declarations as template specializations are
+ introduced, add_friend can be called after the befriending class is
+ fully defined, passing it a non-NULL TYPE argument naming the
+ befriending class type. */
+
+GCC_METHOD2 (int /* bool */, add_friend,
+ gcc_decl, /* Argument DECL. */
+ gcc_type) /* Argument TYPE. */
+
+/* Return the type of a pointer to a given base type. */
+
+GCC_METHOD1 (gcc_type, build_pointer_type,
+ gcc_type) /* Argument BASE_TYPE. */
+
+/* Return the type of a reference to a given base type. */
+
+GCC_METHOD2 (gcc_type, build_reference_type,
+ gcc_type, /* Argument BASE_TYPE. */
+ enum gcc_cp_ref_qualifiers) /* Argument RQUALS. */
+
+/* Create a new pointer-to-member type. MEMBER_TYPE is the data
+ member type, while CLASS_TYPE is the class type containing the data
+ member. For pointers to member functions, MEMBER_TYPE must be a
+ method type, and CLASS_TYPE must be specified even though it might
+ be possible to extract it from the method type. */
+
+GCC_METHOD2 (gcc_type, build_pointer_to_member_type,
+ gcc_type, /* Argument CLASS_TYPE. */
+ gcc_type) /* Argument MEMBER_TYPE. */
+
+/* Start a template parameter list scope and enters it, so that
+ subsequent build_type_template_parameter and
+ build_value_template_parameter calls create template parameters in
+ the list. The list is closed by a build_decl call with
+ GCC_CP_SYMBOL_FUNCTION or GCC_CP_SYMBOL_CLASS, that, when the scope
+ is a template parameter list, declares a template function or a
+ template class with the then-closed parameter list. The scope in
+ which the new declaration is to be introduced by build_decl must be
+ entered before calling start_template_decl, and build_decl returns
+ to that scope, from the template parameter list scope, before
+ introducing the declaration. */
+
+GCC_METHOD0 (int /* bool */, start_template_decl)
+
+/* Build a typename template-parameter (e.g., the T in template
+ <typename T = X>). Either PACK_P should be nonzero, to indicate an
+ argument pack (the last argument in a variadic template argument
+ list, as in template <typename... T>), or DEFAULT_TYPE may be
+ non-NULL to set the default type argument (e.g. X) for the template
+ parameter. FILENAME and LINE_NUMBER may specify the source
+ location in which the template parameter was declared. */
+
+GCC_METHOD5 (gcc_type, build_type_template_parameter,
+ const char *, /* Argument ID. */
+ int /* bool */, /* Argument PACK_P. */
+ gcc_type, /* Argument DEFAULT_TYPE. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Build a template template-parameter (e.g., the T in template
+ <template <[...]> class T = X>). DEFAULT_TEMPL may be non-NULL to
+ set the default type-template argument (e.g. X) for the template
+ template parameter. FILENAME and LINE_NUMBER may specify the
+ source location in which the template parameter was declared. */
+
+GCC_METHOD5 (gcc_utempl, build_template_template_parameter,
+ const char *, /* Argument ID. */
+ int /* bool */, /* Argument PACK_P. */
+ gcc_utempl, /* Argument DEFAULT_TEMPL. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Build a value template-parameter (e.g., the V in template <typename
+ T, T V> or in template <int V = X>). DEFAULT_VALUE may be non-NULL
+ to set the default value argument for the template parameter (e.g.,
+ X). FILENAME and LINE_NUMBER may specify the source location in
+ which the template parameter was declared. */
+
+GCC_METHOD5 (gcc_decl, build_value_template_parameter,
+ gcc_type, /* Argument TYPE. */
+ const char *, /* Argument ID. */
+ gcc_expr, /* Argument DEFAULT_VALUE. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Build a template-dependent typename (e.g., typename T::bar or
+ typename T::template bart<X>). ENCLOSING_TYPE should be the
+ template-dependent nested name specifier (e.g., T), ID should be
+ the name of the member of the ENCLOSING_TYPE (e.g., bar or bart),
+ and TARGS should be non-NULL and specify the template arguments
+ (e.g. <X>) iff ID is to name a class template.
+
+ In this and other calls, a template-dependent nested name specifier
+ may be a template class parameter (build_type_template_parameter),
+ a specialization (returned by build_dependent_type_template_id) of
+ a template template parameter (returned by
+ build_template_template_parameter) or a member type thereof
+ (returned by build_dependent_typename itself). */
+
+GCC_METHOD3 (gcc_type, build_dependent_typename,
+ gcc_type, /* Argument ENCLOSING_TYPE. */
+ const char *, /* Argument ID. */
+ const struct gcc_cp_template_args *) /* Argument TARGS. */
+
+/* Build a template-dependent class template (e.g., T::template bart).
+ ENCLOSING_TYPE should be the template-dependent nested name
+ specifier (e.g., T), ID should be the name of the class template
+ member of the ENCLOSING_TYPE (e.g., bart). */
+
+GCC_METHOD2 (gcc_utempl, build_dependent_class_template,
+ gcc_type, /* Argument ENCLOSING_TYPE. */
+ const char *) /* Argument ID. */
+
+/* Build a template-dependent type template-id (e.g., T<A>).
+ TEMPLATE_DECL should be a template template parameter (e.g., the T
+ in template <template <[...]> class T = X>), and TARGS should
+ specify the template arguments (e.g. <A>). */
+
+GCC_METHOD2 (gcc_type, build_dependent_type_template_id,
+ gcc_utempl, /* Argument TEMPLATE_DECL. */
+ const struct gcc_cp_template_args *) /* Argument TARGS. */
+
+/* Build a template-dependent expression (e.g., S::val or S::template
+ mtf<X>, or unqualified f or template tf<X>).
+
+ ENCLOSING_SCOPE should be a template-dependent nested name
+ specifier (e.g., T), a resolved namespace or class decl, or NULL
+ for unqualified names; ID should be the name of the member of the
+ ENCLOSING_SCOPE (e.g., val or mtf) or unqualified overloaded
+ function; and TARGS should list template arguments (e.g. <X>) when
+ mtf or tf are to name a template function, or be NULL otherwise.
+
+ Unqualified names and namespace- or class-qualified names can only
+ resolve to overloaded functions, to be used in contexts that
+ involve overload resolution that cannot be resolved because of
+ template-dependent argument or return types, such as call
+ expressions with template-dependent arguments, conversion
+ expressions to function types with template-dependent argument
+ types or the like. Other cases of unqualified or
+ non-template-dependent-qualified names should NOT use this
+ function, and use decl_expr to convert the appropriate function or
+ object declaration to an expression.
+
+ If ID is the name of a special member function, FLAGS should be
+ GCC_CP_SYMBOL_FUNCTION|GCC_CP_FLAG_SPECIAL_FUNCTION, and ID should
+ be one of the encodings for special member functions documented in
+ build_decl. Otherwise, FLAGS should be GCC_CP_SYMBOL_MASK, which
+ suggests the symbol kind is not known (though we know it is not a
+ type).
+
+ If ID denotes a conversion operator, CONV_TYPE should name the
+ target type of the conversion. Otherwise, CONV_TYPE must be
+ NULL. */
+
+GCC_METHOD5 (gcc_expr, build_dependent_expr,
+ gcc_decl, /* Argument ENCLOSING_SCOPE. */
+ enum gcc_cp_symbol_kind, /* Argument FLAGS. */
+ const char *, /* Argument NAME. */
+ gcc_type, /* Argument CONV_TYPE. */
+ const struct gcc_cp_template_args *) /* Argument TARGS. */
+
+/* Build a gcc_expr for the value VALUE in type TYPE. */
+
+GCC_METHOD2 (gcc_expr, build_literal_expr,
+ gcc_type, /* Argument TYPE. */
+ unsigned long) /* Argument VALUE. */
+
+/* Build a gcc_expr that denotes DECL, the declaration of a variable
+ or function in namespace scope, or of a static member variable or
+ function. Use QUALIFIED_P to build the operand of unary & so as to
+ compute a pointer-to-member, rather than a regular pointer. */
+
+GCC_METHOD2 (gcc_expr, build_decl_expr,
+ gcc_decl, /* Argument DECL. */
+ int /* bool */) /* Argument QUALIFIED_P. */
+
+/* Build a gcc_expr that denotes the unary operation UNARY_OP applied
+ to the gcc_expr OPERAND. For non-expr operands, see
+ unary_type_expr. Besides the UNARY_OP encodings used for operator
+ names, we support "pp_" for preincrement, and "mm_" for
+ predecrement, "nx" for noexcept, "tw" for throw, "tr" for rethrow
+ (pass NULL as the operand), "te" for typeid, "sz" for sizeof, "az"
+ for alignof, "dl" for delete, "gsdl" for ::delete, "da" for
+ delete[], "gsda" for ::delete[], "sp" for pack expansion, "sZ" for
+ sizeof...(function argument pack). */
+
+GCC_METHOD2 (gcc_expr, build_unary_expr,
+ const char *, /* Argument UNARY_OP. */
+ gcc_expr) /* Argument OPERAND. */
+
+/* Build a gcc_expr that denotes the binary operation BINARY_OP
+ applied to gcc_exprs OPERAND1 and OPERAND2. Besides the BINARY_OP
+ encodings used for operator names, we support "ds" for the operator
+ token ".*" and "dt" for the operator token ".". When using
+ operators that take a name as their second operand ("." and "->")
+ use decl_expr to convert the gcc_decl of the member name to a
+ gcc_expr, if the member name wasn't created with
+ e.g. build_dependent_expr. */
+
+GCC_METHOD3 (gcc_expr, build_binary_expr,
+ const char *, /* Argument BINARY_OP. */
+ gcc_expr, /* Argument OPERAND1. */
+ gcc_expr) /* Argument OPERAND2. */
+
+/* Build a gcc_expr that denotes the ternary operation TERNARY_OP
+ applied to gcc_exprs OPERAND1, OPERAND2 and OPERAND3. The only
+ supported TERNARY_OP is "qu", for the "?:" operator. */
+
+GCC_METHOD4 (gcc_expr, build_ternary_expr,
+ const char *, /* Argument TERNARY_OP. */
+ gcc_expr, /* Argument OPERAND1. */
+ gcc_expr, /* Argument OPERAND2. */
+ gcc_expr) /* Argument OPERAND3. */
+
+/* Build a gcc_expr that denotes the unary operation UNARY_OP applied
+ to the gcc_type OPERAND. Supported unary operations taking types
+ are "ti" for typeid, "st" for sizeof, "at" for alignof, and "sZ"
+ for sizeof...(template argument pack). */
+
+GCC_METHOD2 (gcc_expr, build_unary_type_expr,
+ const char *, /* Argument UNARY_OP. */
+ gcc_type) /* Argument OPERAND. */
+
+/* Build a gcc_expr that denotes the binary operation BINARY_OP
+ applied to gcc_type OPERAND1 and gcc_expr OPERAND2. Use this for
+ all kinds of (single-argument) type casts ("dc", "sc", "cc", "rc"
+ for dynamic, static, const and reinterpret casts, respectively;
+ "cv" for functional or C-style casts). */
+
+GCC_METHOD3 (gcc_expr, build_cast_expr,
+ const char *, /* Argument BINARY_OP. */
+ gcc_type, /* Argument OPERAND1. */
+ gcc_expr) /* Argument OPERAND2. */
+
+/* Build a gcc_expr that denotes the conversion of an expression list
+ VALUES to TYPE, with ("tl") or without ("cv") braces, or a braced
+ initializer list of unspecified type (e.g., a component of another
+ braced initializer list; pass "il" for CONV_OP, and NULL for
+ TYPE). */
+
+GCC_METHOD3 (gcc_expr, build_expression_list_expr,
+ const char *, /* Argument CONV_OP. */
+ gcc_type, /* Argument TYPE. */
+ const struct gcc_cp_function_args *) /* Argument VALUES. */
+
+/* Build a gcc_expr that denotes a new ("nw") or new[] ("na")
+ expression of TYPE, with or without a GLOBAL_NS qualifier (prefix
+ the NEW_OP with "gs"), with or without PLACEMENT, with or without
+ INITIALIZER. If it's not a placement new, PLACEMENT must be NULL
+ (rather than a zero-length placement arg list). If there's no
+ specified initializer, INITIALIZER must be NULL; a zero-length arg
+ list stands for a default initializer. */
+
+GCC_METHOD4 (gcc_expr, build_new_expr,
+ const char *, /* Argument NEW_OP. */
+ const struct gcc_cp_function_args *, /* Argument PLACEMENT. */
+ gcc_type, /* Argument TYPE. */
+ const struct gcc_cp_function_args *) /* Argument INITIALIZER. */
+
+/* Return a call expression that calls CALLABLE with arguments ARGS.
+ CALLABLE may be a function, a callable object, a pointer to
+ function, an unresolved expression, an unresolved overload set, an
+ object expression combined with a member function overload set or a
+ pointer-to-member. If QUALIFIED_P, CALLABLE will be interpreted as
+ a qualified name, preventing virtual function dispatch. */
+
+GCC_METHOD3 (gcc_expr, build_call_expr,
+ gcc_expr, /* Argument CALLABLE. */
+ int /* bool */, /* Argument QUALIFIED_P. */
+ const struct gcc_cp_function_args *) /* Argument ARGS. */
+
+/* Return the type of the gcc_expr OPERAND.
+ Use this for decltype.
+ For decltype (auto), pass a NULL OPERAND.
+
+ Note: for template-dependent expressions, the result is NULL,
+ because the type is only computed when template argument
+ substitution is performed. */
+
+GCC_METHOD1 (gcc_type, get_expr_type,
+ gcc_expr) /* Argument OPERAND. */
+
+/* Introduce a specialization of a template function.
+
+ TEMPLATE_DECL is the template function, and TARGS are the arguments
+ for the specialization. ADDRESS is the address of the
+ specialization. FILENAME and LINE_NUMBER specify the source
+ location associated with the template function specialization. */
+
+GCC_METHOD5 (gcc_decl, build_function_template_specialization,
+ gcc_decl, /* Argument TEMPLATE_DECL. */
+ const struct gcc_cp_template_args *, /* Argument TARGS. */
+ gcc_address, /* Argument ADDRESS. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Specialize a template class as an incomplete type. A definition
+ can be supplied later, with start_class_type.
+
+ TEMPLATE_DECL is the template class, and TARGS are the arguments
+ for the specialization. FILENAME and LINE_NUMBER specify the
+ source location associated with the template class
+ specialization. */
+
+GCC_METHOD4 (gcc_decl, build_class_template_specialization,
+ gcc_decl, /* Argument TEMPLATE_DECL. */
+ const struct gcc_cp_template_args *, /* Argument TARGS. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Start defining a 'class', 'struct' or 'union' type, entering its
+ own binding level. Initially it has no fields.
+
+ TYPEDECL is the forward-declaration of the type, returned by
+ build_decl. BASE_CLASSES indicate the base classes of class NAME.
+ FILENAME and LINE_NUMBER specify the source location associated
+ with the class definition, should they be different from those of
+ the forward declaration. */
+
+GCC_METHOD4 (gcc_type, start_class_type,
+ gcc_decl, /* Argument TYPEDECL. */
+ const struct gcc_vbase_array *,/* Argument BASE_CLASSES. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Create a new closure class type, record it as the
+ DISCRIMINATOR-numbered closure type in the current scope (or
+ associated with EXTRA_SCOPE, if non-NULL), and enter the closure
+ type's own binding level. This primitive would sort of combine
+ build_decl and start_class_type, if they could be used to introduce
+ a closure type. Initially it has no fields.
+
+ FILENAME and LINE_NUMBER specify the source location associated
+ with the class. EXTRA_SCOPE, if non-NULL, must be a PARM_DECL of
+ the current function, or a FIELD_DECL of the current class. If it
+ is NULL, the current scope must be a function. */
+
+GCC_METHOD5 (gcc_type, start_closure_class_type,
+ int, /* Argument DISCRIMINATOR. */
+ gcc_decl, /* Argument EXTRA_SCOPE. */
+ enum gcc_cp_symbol_kind, /* Argument FLAGS. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Add a non-static data member to the most-recently-started
+ unfinished struct or union type. FIELD_NAME is the field's name.
+ FIELD_TYPE is the type of the field. BITSIZE and BITPOS indicate
+ where in the struct the field occurs. */
+
+GCC_METHOD5 (gcc_decl, build_field,
+ const char *, /* Argument FIELD_NAME. */
+ gcc_type, /* Argument FIELD_TYPE. */
+ enum gcc_cp_symbol_kind, /* Argument FIELD_FLAGS. */
+ unsigned long, /* Argument BITSIZE. */
+ unsigned long) /* Argument BITPOS. */
+
+/* After all the fields have been added to a struct, class or union,
+ the struct or union type must be "finished". This does some final
+ cleanups in GCC, and pops to the binding level that was in effect
+ before the matching start_class_type or
+ start_closure_class_type. */
+
+GCC_METHOD1 (int /* bool */, finish_class_type,
+ unsigned long) /* Argument SIZE_IN_BYTES. */
+
+/* Create a new 'enum' type, and record it in the current binding
+ level. The new type initially has no associated constants.
+
+ NAME is the enum name. FILENAME and LINE_NUMBER specify its source
+ location. */
+
+GCC_METHOD5 (gcc_type, start_enum_type,
+ const char *, /* Argument NAME. */
+ gcc_type, /* Argument UNDERLYING_INT_TYPE. */
+ enum gcc_cp_symbol_kind, /* Argument FLAGS. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Add a new constant to an enum type. NAME is the constant's name
+ and VALUE is its value. Returns a gcc_decl for the constant. */
+
+GCC_METHOD3 (gcc_decl, build_enum_constant,
+ gcc_type, /* Argument ENUM_TYPE. */
+ const char *, /* Argument NAME. */
+ unsigned long) /* Argument VALUE. */
+
+/* After all the constants have been added to an enum, the type must
+ be "finished". This does some final cleanups in GCC. */
+
+GCC_METHOD1 (int /* bool */, finish_enum_type,
+ gcc_type) /* Argument ENUM_TYPE. */
+
+/* Create a new function type. RETURN_TYPE is the type returned by
+ the function, and ARGUMENT_TYPES is a vector, of length NARGS, of
+ the argument types. IS_VARARGS is true if the function is
+ varargs. */
+
+GCC_METHOD3 (gcc_type, build_function_type,
+ gcc_type, /* Argument RETURN_TYPE. */
+ const struct gcc_type_array *,/* Argument ARGUMENT_TYPES. */
+ int /* bool */) /* Argument IS_VARARGS. */
+
+/* Create a variant of a function type with an exception
+ specification. FUNCTION_TYPE is a function or method type.
+ EXCEPT_TYPES is an array with the list of exception types. Zero as
+ the array length implies throw() AKA noexcept(true); NULL as the
+ pointer to gcc_type_array implies noexcept(false), which is almost
+ equivalent (but distinguishable by the compiler) to an unspecified
+ exception list. */
+
+GCC_METHOD2 (gcc_type, build_exception_spec_variant,
+ gcc_type, /* Argument FUNCTION_TYPE. */
+ const struct gcc_type_array *)/* Argument EXCEPT_TYPES. */
+
+/* Create a new non-static member function type. FUNC_TYPE is the
+ method prototype, without the implicit THIS pointer, added as a
+ pointer to the QUALS-qualified CLASS_TYPE. If CLASS_TYPE is NULL,
+ this creates a cv-qualified (member) function type not associated
+ with any specific class, as needed to support "typedef void f(int)
+ const;", which can later be used to declare member functions and
+ pointers to member functions. */
+
+GCC_METHOD4 (gcc_type, build_method_type,
+ gcc_type, /* Argument CLASS_TYPE. */
+ gcc_type, /* Argument FUNC_TYPE. */
+ enum gcc_cp_qualifiers, /* Argument QUALS. */
+ enum gcc_cp_ref_qualifiers) /* Argument RQUALS. */
+
+/* Return a declaration for the (INDEX - 1)th argument of
+ FUNCTION_DECL, i.e., for the first argument, use zero as the index.
+ If FUNCTION_DECL is a non-static member function, use -1 to get the
+ implicit THIS parameter. */
+
+GCC_METHOD2 (gcc_decl, get_function_parameter_decl,
+ gcc_decl, /* Argument FUNCTION_DECL. */
+ int) /* Argument INDEX. */
+
+/* Return a lambda expr that constructs an instance of CLOSURE_TYPE.
+ Only lambda exprs without any captures can be correctly created
+ through these mechanisms; that's all we need to support lambdas
+ expressions in default parameters, the only kind that may have to
+ be introduced through this interface. */
+
+GCC_METHOD1 (gcc_expr, build_lambda_expr,
+ gcc_type) /* Argument CLOSURE_TYPE. */
+
+/* Return an integer type with the given properties. If BUILTIN_NAME
+ is non-NULL, it must name a builtin integral type with the given
+ signedness and size, and that is the type that will be returned. */
+
+GCC_METHOD3 (gcc_type, get_int_type,
+ int /* bool */, /* Argument IS_UNSIGNED. */
+ unsigned long, /* Argument SIZE_IN_BYTES. */
+ const char *) /* Argument BUILTIN_NAME. */
+
+/* Return the 'char' type, a distinct type from both 'signed char' and
+ 'unsigned char' returned by int_type. */
+
+GCC_METHOD0 (gcc_type, get_char_type)
+
+/* Return a floating point type with the given properties. If BUILTIN_NAME
+ is non-NULL, it must name a builtin integral type with the given
+ signedness and size, and that is the type that will be returned. */
+
+GCC_METHOD2 (gcc_type, get_float_type,
+ unsigned long, /* Argument SIZE_IN_BYTES. */
+ const char *) /* Argument BUILTIN_NAME. */
+
+/* Return the 'void' type. */
+
+GCC_METHOD0 (gcc_type, get_void_type)
+
+/* Return the 'bool' type. */
+
+GCC_METHOD0 (gcc_type, get_bool_type)
+
+/* Return the std::nullptr_t type. */
+
+GCC_METHOD0 (gcc_type, get_nullptr_type)
+
+/* Return the nullptr constant. */
+
+GCC_METHOD0 (gcc_expr, get_nullptr_constant)
+
+/* Create a new array type. If NUM_ELEMENTS is -1, then the array
+ is assumed to have an unknown length. */
+
+GCC_METHOD2 (gcc_type, build_array_type,
+ gcc_type, /* Argument ELEMENT_TYPE. */
+ int) /* Argument NUM_ELEMENTS. */
+
+/* Create a new array type. NUM_ELEMENTS is a template-dependent
+ expression. */
+
+GCC_METHOD2 (gcc_type, build_dependent_array_type,
+ gcc_type, /* Argument ELEMENT_TYPE. */
+ gcc_expr) /* Argument NUM_ELEMENTS. */
+
+/* Create a new variably-sized array type. UPPER_BOUND_NAME is the
+ name of a local variable that holds the upper bound of the array;
+ it is one less than the array size. */
+
+GCC_METHOD2 (gcc_type, build_vla_array_type,
+ gcc_type, /* Argument ELEMENT_TYPE. */
+ const char *) /* Argument UPPER_BOUND_NAME. */
+
+/* Return a qualified variant of a given base type. QUALIFIERS says
+ which qualifiers to use; it is composed of or'd together
+ constants from 'enum gcc_cp_qualifiers'. */
+
+GCC_METHOD2 (gcc_type, build_qualified_type,
+ gcc_type, /* Argument UNQUALIFIED_TYPE. */
+ enum gcc_cp_qualifiers) /* Argument QUALIFIERS. */
+
+/* Build a complex type given its element type. */
+
+GCC_METHOD1 (gcc_type, build_complex_type,
+ gcc_type) /* Argument ELEMENT_TYPE. */
+
+/* Build a vector type given its element type and number of
+ elements. */
+
+GCC_METHOD2 (gcc_type, build_vector_type,
+ gcc_type, /* Argument ELEMENT_TYPE. */
+ int) /* Argument NUM_ELEMENTS. */
+
+/* Build a constant. NAME is the constant's name and VALUE is its
+ value. FILENAME and LINE_NUMBER refer to the type's source
+ location. If this is not known, FILENAME can be NULL and
+ LINE_NUMBER can be 0. */
+
+GCC_METHOD5 (int /* bool */, build_constant,
+ gcc_type, /* Argument TYPE. */
+ const char *, /* Argument NAME. */
+ unsigned long, /* Argument VALUE. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+/* Emit an error and return an error type object. */
+
+GCC_METHOD1 (gcc_type, error,
+ const char *) /* Argument MESSAGE. */
+
+/* Declare a static_assert with the given CONDITION and ERRORMSG at
+ FILENAME:LINE_NUMBER. */
+
+GCC_METHOD4 (int /* bool */, add_static_assert,
+ gcc_expr, /* Argument CONDITION. */
+ const char *, /* Argument ERRORMSG. */
+ const char *, /* Argument FILENAME. */
+ unsigned int) /* Argument LINE_NUMBER. */
+
+#if 0
+
+/* FIXME: We don't want to expose the internal implementation detail
+ that default parms are stored in function types, and it's not clear
+ how this or other approaches would interact with the type sharing
+ of e.g. ctor clones, so we're leaving this out, since default args
+ are not even present in debug information anyway. Besides, the set
+ of default args for a function may grow within its scope, and vary
+ independently in other scopes. */
+
+/* Create a modified version of a function type that has default
+ values for some of its arguments. The returned type should ONLY be
+ used to define functions or methods, never to declare parameters,
+ variables, types or the like.
+
+ DEFAULTS must have at most as many N_ELEMENTS as there are
+ arguments without default values in FUNCTION_TYPE. Say, if
+ FUNCTION_TYPE has an argument list such as (T1, T2, T3, T4 = V0)
+ and DEFAULTS has 2 elements (V1, V2), the returned type will have
+ the following argument list: (T1, T2 = V1, T3 = V2, T4 = V0).
+
+ Any NULL expressions in DEFAULTS will be marked as deferred, and
+ they should be filled in with set_deferred_function_default_args. */
+
+GCC_METHOD2 (gcc_type, add_function_default_args,
+ gcc_type, /* Argument FUNCTION_TYPE. */
+ const struct gcc_cp_function_args *) /* Argument DEFAULTS. */
+
+/* Fill in the first deferred default args in FUNCTION_DECL with the
+ expressions given in DEFAULTS. This can be used when the
+ declaration of a parameter is needed to create a default
+ expression, such as taking the size of an earlier parameter, or
+ building a lambda expression in the parameter's context. */
+
+GCC_METHOD2 (int /* bool */, set_deferred_function_default_args,
+ gcc_decl, /* Argument FUNCTION_DECL. */
+ const struct gcc_cp_function_args *) /* Argument DEFAULTS. */
+
+#endif
+
+
+/* When you add entry points, add them at the end, so that the new API
+ version remains compatible with the old version.
+
+ The following conventions have been observed as to naming entry points:
+
+ - build_* creates (and maybe records) something and returns it;
+ - add_* creates and records something, but doesn't return it;
+ - get_* obtains something without creating it;
+ - start_* marks the beginning of a compound (type, list, ...);
+ - finish_* completes the compound when needed.
+
+ Entry points that return an int (bool) and don't have a return value
+ specification return nonzero (true) on success and zero (false) on
+ failure. This is in line with libcc1's conventions of returning a
+ zero-initialized value in case of e.g. a transport error. */
diff --git a/include/gcc-cp-interface.h b/include/gcc-cp-interface.h
new file mode 100644
index 0000000000..6ef9e22f50
--- /dev/null
+++ b/include/gcc-cp-interface.h
@@ -0,0 +1,496 @@
+/* Interface between GCC C++ FE and GDB
+
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ This program 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 of the License, or
+ (at your option) any later version.
+
+ This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef GCC_CP_INTERFACE_H
+#define GCC_CP_INTERFACE_H
+
+#include "gcc-interface.h"
+
+/* This header defines the interface to the GCC API. It must be both
+ valid C and valid C++, because it is included by both programs. */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declaration. */
+
+struct gcc_cp_context;
+
+/*
+ * Definitions and declarations for the C++ front end.
+ */
+
+/* Defined versions of the C++ front-end API. */
+
+enum gcc_cp_api_version
+{
+ GCC_CP_FE_VERSION_0 = 0
+};
+
+/* Qualifiers. */
+
+enum gcc_cp_qualifiers
+{
+ GCC_CP_QUALIFIER_CONST = 1,
+ GCC_CP_QUALIFIER_VOLATILE = 2,
+ GCC_CP_QUALIFIER_RESTRICT = 4
+};
+
+/* Ref qualifiers. */
+
+enum gcc_cp_ref_qualifiers {
+ GCC_CP_REF_QUAL_NONE = 0,
+ GCC_CP_REF_QUAL_LVALUE = 1,
+ GCC_CP_REF_QUAL_RVALUE = 2
+};
+
+/* Opaque typedef for unbound class templates. They are used for
+ template arguments, and defaults for template template
+ parameters. */
+
+typedef unsigned long long gcc_utempl;
+
+/* Opaque typedef for expressions. They are used for template
+ arguments, defaults for non-type template parameters, and defaults
+ for function arguments. */
+
+typedef unsigned long long gcc_expr;
+
+typedef enum
+ { GCC_CP_TPARG_VALUE, GCC_CP_TPARG_CLASS,
+ GCC_CP_TPARG_TEMPL, GCC_CP_TPARG_PACK }
+gcc_cp_template_arg_kind;
+
+typedef union
+{ gcc_expr value; gcc_type type; gcc_utempl templ; gcc_type pack; }
+gcc_cp_template_arg;
+
+/* An array of template arguments. */
+
+struct gcc_cp_template_args
+{
+ /* Number of elements. */
+
+ int n_elements;
+
+ /* kind[i] indicates what kind of template argument type[i] is. */
+
+ char /* gcc_cp_template_arg_kind */ *kinds;
+
+ /* The template arguments. */
+
+ gcc_cp_template_arg *elements;
+};
+
+/* An array of (default) function arguments. */
+
+struct gcc_cp_function_args
+{
+ /* Number of elements. */
+
+ int n_elements;
+
+ /* The (default) values for each argument. */
+
+ gcc_expr *elements;
+};
+
+/* This enumerates the kinds of decls that GDB can create. */
+
+enum gcc_cp_symbol_kind
+{
+ /* A function. */
+
+ GCC_CP_SYMBOL_FUNCTION,
+
+ /* A variable. */
+
+ GCC_CP_SYMBOL_VARIABLE,
+
+ /* A typedef, or an alias declaration (including template ones). */
+
+ GCC_CP_SYMBOL_TYPEDEF,
+
+ /* A label. */
+
+ GCC_CP_SYMBOL_LABEL,
+
+ /* A class, forward declared in build_decl (to be later defined in
+ start_class_definition), or, in a template parameter list scope,
+ a declaration of a template class, closing the parameter
+ list. */
+
+ GCC_CP_SYMBOL_CLASS,
+
+ /* A union, forward declared in build_decl (to be later defined in
+ start_class_definition). */
+
+ GCC_CP_SYMBOL_UNION,
+
+ /* An enumeration type being introduced with start_new_enum_type. */
+
+ GCC_CP_SYMBOL_ENUM,
+
+ /* A nonstatic data member being introduced with new_field. */
+
+ GCC_CP_SYMBOL_FIELD,
+
+ /* A base class in a gcc_vbase_array. */
+
+ GCC_CP_SYMBOL_BASECLASS,
+
+ /* A using declaration in new_using_decl. */
+
+ GCC_CP_SYMBOL_USING,
+
+ /* A (lambda) closure class type. In many regards this is just like
+ a regular class, but it's not supposed to have base classes, some
+ of the member functions that are usually implicitly-defined are
+ deleted, and it should have an operator() member function that
+ holds the lambda body. We can't instantiate objects of lambda
+ types from the snippet, but we can interact with them in such
+ ways as passing them to functions that take their types, and
+ calling their body. */
+
+ GCC_CP_SYMBOL_LAMBDA_CLOSURE,
+
+ /* Marker to check that we haven't exceeded GCC_CP_SYMBOL_MASK. */
+ GCC_CP_SYMBOL_END,
+
+ GCC_CP_SYMBOL_MASK = 15,
+
+ /* When defining a class member, at least one of the
+ GCC_CP_ACCESS_MASK bits must be set; when defining a namespace-
+ or union-scoped symbol, none of them must be set. */
+
+ GCC_CP_ACCESS_PRIVATE,
+ GCC_CP_ACCESS_PUBLIC = GCC_CP_ACCESS_PRIVATE << 1,
+ GCC_CP_ACCESS_MASK = (GCC_CP_ACCESS_PUBLIC
+ | GCC_CP_ACCESS_PRIVATE),
+ GCC_CP_ACCESS_PROTECTED = GCC_CP_ACCESS_MASK,
+ GCC_CP_ACCESS_NONE = 0,
+
+ GCC_CP_FLAG_BASE = GCC_CP_ACCESS_PRIVATE << 2,
+
+ /* Flags to be used along with GCC_CP_SYMBOL_FUNCTION: */
+
+ /* This flag should be set for constructors, destructors and
+ operators. */
+ GCC_CP_FLAG_SPECIAL_FUNCTION = GCC_CP_FLAG_BASE,
+
+ /* We intentionally cannot express inline, constexpr, or virtual
+ override for functions. We can't inline or constexpr-replace
+ without a source-level body. The override keyword is only
+ meaningful within the definition of the containing class. */
+
+ /* This indicates a "virtual" member function, explicitly or
+ implicitly (due to a virtual function with the same name and
+ prototype in a base class) declared as such. */
+ GCC_CP_FLAG_VIRTUAL_FUNCTION = GCC_CP_FLAG_BASE << 1,
+
+ /* The following two flags should only be set when the flag above is
+ set. */
+
+ /* This indicates a pure virtual member function, i.e., one that is
+ declared with "= 0", even if a body is provided in the
+ definition. */
+ GCC_CP_FLAG_PURE_VIRTUAL_FUNCTION = GCC_CP_FLAG_BASE << 2,
+
+ /* This indicates a "final" virtual member function. */
+ GCC_CP_FLAG_FINAL_VIRTUAL_FUNCTION = GCC_CP_FLAG_BASE << 3,
+
+ /* This indicates a special member function should have its default
+ implementation. This either means the function declaration
+ contains the "= default" tokens, or that the member function was
+ implicitly generated by the compiler, although the latter use is
+ discouraged: just let the compiler implicitly introduce it.
+
+ A member function defaulted after its first declaration has
+ slightly different ABI implications from one implicitly generated
+ or explicitly defaulted at the declaration (and definition)
+ point. To avoid silent (possibly harmless) violation of the one
+ definition rule, it is recommended that this flag not be used for
+ such functions, and that the address of the definition be
+ supplied instead. */
+ GCC_CP_FLAG_DEFAULTED_FUNCTION = GCC_CP_FLAG_BASE << 4,
+
+ /* This indicates a deleted member function, i.e., one that has been
+ defined as "= delete" at its declaration point, or one that has
+ been implicitly defined as deleted (with or without an explicit
+ "= default" definition).
+
+ This should not be used for implicitly-declared member functions
+ that resolve to deleted definitions, as it may affect the
+ implicit declaration of other member functions. */
+ GCC_CP_FLAG_DELETED_FUNCTION = GCC_CP_FLAG_BASE << 5,
+
+ /* This indicates a constructor or type-conversion operator declared
+ as "explicit". */
+
+ GCC_CP_FLAG_EXPLICIT_FUNCTION = GCC_CP_FLAG_BASE << 6,
+
+ GCC_CP_FLAG_END_FUNCTION,
+ GCC_CP_FLAG_MASK_FUNCTION = (((GCC_CP_FLAG_END_FUNCTION - 1) << 1)
+ - GCC_CP_FLAG_BASE),
+
+ /* Flags to be used along with GCC_CP_SYMBOL_VARIABLE: */
+
+ /* This indicates a variable declared as "constexpr". */
+
+ GCC_CP_FLAG_CONSTEXPR_VARIABLE = GCC_CP_FLAG_BASE,
+
+ /* This indicates a variable declared as "thread_local". ??? What
+ should the ADDRESS be? */
+
+ GCC_CP_FLAG_THREAD_LOCAL_VARIABLE = GCC_CP_FLAG_BASE << 1,
+
+ GCC_CP_FLAG_END_VARIABLE,
+ GCC_CP_FLAG_MASK_VARIABLE = (((GCC_CP_FLAG_END_VARIABLE - 1) << 1)
+ - GCC_CP_FLAG_BASE),
+
+ /* Flags to be used when defining nonstatic data members of classes
+ with new_field. */
+
+ /* Use this when no flags are present. */
+ GCC_CP_FLAG_FIELD_NOFLAG = 0,
+
+ /* This indicates the field is declared as mutable. */
+ GCC_CP_FLAG_FIELD_MUTABLE = GCC_CP_FLAG_BASE,
+
+ GCC_CP_FLAG_END_FIELD,
+ GCC_CP_FLAG_MASK_FIELD = (((GCC_CP_FLAG_END_FIELD - 1) << 1)
+ - GCC_CP_FLAG_BASE),
+
+ /* Flags to be used when defining an enum with
+ start_new_enum_type. */
+
+ /* This indicates an enum type without any flags. */
+ GCC_CP_FLAG_ENUM_NOFLAG = 0,
+
+ /* This indicates a scoped enum type. */
+ GCC_CP_FLAG_ENUM_SCOPED = GCC_CP_FLAG_BASE,
+
+ GCC_CP_FLAG_END_ENUM,
+ GCC_CP_FLAG_MASK_ENUM = (((GCC_CP_FLAG_END_ENUM - 1) << 1)
+ - GCC_CP_FLAG_BASE),
+
+
+ /* Flags to be used when introducing a class or a class template
+ with build_decl. */
+
+ /* This indicates an enum type without any flags. */
+ GCC_CP_FLAG_CLASS_NOFLAG = 0,
+
+ /* This indicates the class is actually a struct. This has no
+ effect whatsoever on access control in this interface, since all
+ class members must have explicit access control bits set, but it
+ may affect error messages. */
+ GCC_CP_FLAG_CLASS_IS_STRUCT = GCC_CP_FLAG_BASE,
+
+ GCC_CP_FLAG_END_CLASS,
+ GCC_CP_FLAG_MASK_CLASS = (((GCC_CP_FLAG_END_CLASS - 1) << 1)
+ - GCC_CP_FLAG_BASE),
+
+
+ /* Flags to be used when introducing a virtual base class in a
+ gcc_vbase_array. */
+
+ /* This indicates an enum type without any flags. */
+ GCC_CP_FLAG_BASECLASS_NOFLAG = 0,
+
+ /* This indicates the class is actually a struct. This has no
+ effect whatsoever on access control in this interface, since all
+ class members must have explicit access control bits set, but it
+ may affect error messages. */
+ GCC_CP_FLAG_BASECLASS_VIRTUAL = GCC_CP_FLAG_BASE,
+
+ GCC_CP_FLAG_END_BASECLASS,
+ GCC_CP_FLAG_MASK_BASECLASS = (((GCC_CP_FLAG_END_BASECLASS - 1) << 1)
+ - GCC_CP_FLAG_BASE),
+
+
+ GCC_CP_FLAG_MASK = (GCC_CP_FLAG_MASK_FUNCTION
+ | GCC_CP_FLAG_MASK_VARIABLE
+ | GCC_CP_FLAG_MASK_FIELD
+ | GCC_CP_FLAG_MASK_ENUM
+ | GCC_CP_FLAG_MASK_CLASS
+ | GCC_CP_FLAG_MASK_BASECLASS
+ )
+};
+
+
+/* An array of types used for creating lists of base classes. */
+
+struct gcc_vbase_array
+{
+ /* Number of elements. */
+
+ int n_elements;
+
+ /* The base classes. */
+
+ gcc_type *elements;
+
+ /* Flags for each base class. Used to indicate access control and
+ virtualness. */
+
+ enum gcc_cp_symbol_kind *flags;
+};
+
+
+/* This enumerates the types of symbols that GCC might request from
+ GDB. */
+
+enum gcc_cp_oracle_request
+{
+ /* An identifier in namespace scope -- type, variable, function,
+ namespace, template. All namespace-scoped symbols with the
+ requested name, in any namespace (including the global
+ namespace), should be defined in response to this request. */
+
+ GCC_CP_ORACLE_IDENTIFIER
+};
+
+/* The type of the function called by GCC to ask GDB for a symbol's
+ definition. DATUM is an arbitrary value supplied when the oracle
+ function is registered. CONTEXT is the GCC context in which the
+ request is being made. REQUEST specifies what sort of symbol is
+ being requested, and IDENTIFIER is the name of the symbol. */
+
+typedef void gcc_cp_oracle_function (void *datum,
+ struct gcc_cp_context *context,
+ enum gcc_cp_oracle_request request,
+ const char *identifier);
+
+/* The type of the function called by GCC to ask GDB for a symbol's
+ address. This should return 0 if the address is not known. */
+
+typedef gcc_address gcc_cp_symbol_address_function (void *datum,
+ struct gcc_cp_context *ctxt,
+ const char *identifier);
+
+/* The type of the function called by GCC to ask GDB to enter or leave
+ the user expression scope. */
+
+typedef void gcc_cp_enter_leave_user_expr_scope_function (void *datum,
+ struct gcc_cp_context
+ *context);
+
+/* The vtable used by the C front end. */
+
+struct gcc_cp_fe_vtable
+{
+ /* The version of the C interface. The value is one of the
+ gcc_cp_api_version constants. */
+
+ unsigned int cp_version;
+
+ /* Set the callbacks for this context.
+
+ The binding oracle is called whenever the C++ parser needs to
+ look up a symbol. This gives the caller a chance to lazily
+ instantiate symbols using other parts of the gcc_cp_fe_interface
+ API. The symbol is looked up without a scope, and the oracle
+ must supply a definition for ALL namespace-scoped definitions
+ bound to the symbol.
+
+ The address oracle is called whenever the C++ parser needs to
+ look up a symbol. This may be called for symbols not provided by
+ the symbol oracle, such as built-in functions where GCC provides
+ the declaration; other internal symbols, such as those related
+ with thunks, rtti, and virtual tables are likely to be queried
+ through this interface too. The identifier is a mangled symbol
+ name.
+
+ DATUM is an arbitrary piece of data that is passed back verbatim
+ to the callbacks in requests. */
+
+ void (*set_callbacks) (struct gcc_cp_context *self,
+ gcc_cp_oracle_function *binding_oracle,
+ gcc_cp_symbol_address_function *address_oracle,
+ gcc_cp_enter_leave_user_expr_scope_function *enter_scope,
+ gcc_cp_enter_leave_user_expr_scope_function *leave_scope,
+ void *datum);
+
+#define GCC_METHOD0(R, N) \
+ R (*N) (struct gcc_cp_context *);
+#define GCC_METHOD1(R, N, A) \
+ R (*N) (struct gcc_cp_context *, A);
+#define GCC_METHOD2(R, N, A, B) \
+ R (*N) (struct gcc_cp_context *, A, B);
+#define GCC_METHOD3(R, N, A, B, C) \
+ R (*N) (struct gcc_cp_context *, A, B, C);
+#define GCC_METHOD4(R, N, A, B, C, D) \
+ R (*N) (struct gcc_cp_context *, A, B, C, D);
+#define GCC_METHOD5(R, N, A, B, C, D, E) \
+ R (*N) (struct gcc_cp_context *, A, B, C, D, E);
+#define GCC_METHOD7(R, N, A, B, C, D, E, F, G) \
+ R (*N) (struct gcc_cp_context *, A, B, C, D, E, F, G);
+
+#include "gcc-cp-fe.def"
+
+#undef GCC_METHOD0
+#undef GCC_METHOD1
+#undef GCC_METHOD2
+#undef GCC_METHOD3
+#undef GCC_METHOD4
+#undef GCC_METHOD5
+#undef GCC_METHOD7
+
+};
+
+/* The C front end object. */
+
+struct gcc_cp_context
+{
+ /* Base class. */
+
+ struct gcc_base_context base;
+
+ /* Our vtable. This is a separate field because this is simpler
+ than implementing a vtable inheritance scheme in C. */
+
+ const struct gcc_cp_fe_vtable *cp_ops;
+};
+
+/* The name of the .so that the compiler builds. We dlopen this
+ later. */
+
+#define GCC_CP_FE_LIBCC libcc1.so
+
+/* The compiler exports a single initialization function. This macro
+ holds its name as a symbol. */
+
+#define GCC_CP_FE_CONTEXT gcc_cp_fe_context
+
+/* The type of the initialization function. The caller passes in the
+ desired base version and desired C-specific version. If the
+ request can be satisfied, a compatible gcc_context object will be
+ returned. Otherwise, the function returns NULL. */
+
+typedef struct gcc_cp_context *gcc_cp_fe_context_function
+ (enum gcc_base_api_version,
+ enum gcc_cp_api_version);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GCC_CP_INTERFACE_H */
diff --git a/include/gcc-interface.h b/include/gcc-interface.h
index df7db6ec1d..1dc3498e87 100644
--- a/include/gcc-interface.h
+++ b/include/gcc-interface.h
@@ -1,6 +1,6 @@
/* Generic interface between GCC and GDB
- Copyright (C) 2014-2015 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This file is part of GCC.
@@ -44,7 +44,12 @@ struct gcc_base_context;
enum gcc_base_api_version
{
- GCC_FE_VERSION_0 = 0
+ GCC_FE_VERSION_0 = 0,
+
+ /* Deprecated methods set_arguments_v0 and compile_v0. Added methods
+ set_arguments, set_triplet_regexp, set_driver_filename, set_verbose and
+ compile. */
+ GCC_FE_VERSION_1 = 1,
};
/* The operations defined by the GCC base API. This is the vtable for
@@ -64,20 +69,12 @@ struct gcc_base_vtable
unsigned int version;
- /* Set the compiler's command-line options for the next compilation.
- TRIPLET_REGEXP is a regular expression that is used to match the
- configury triplet prefix to the compiler.
- The arguments are copied by GCC. ARGV need not be
- NULL-terminated. The arguments must be set separately for each
- compilation; that is, after a compile is requested, the
- previously-set arguments cannot be reused.
+ /* Deprecated GCC_FE_VERSION_0 variant of the GCC_FE_VERSION_1
+ methods set_triplet_regexp and set_arguments. */
- This returns NULL on success. On failure, returns a malloc()d
- error message. The caller is responsible for freeing it. */
-
- char *(*set_arguments) (struct gcc_base_context *self,
- const char *triplet_regexp,
- int argc, char **argv);
+ char *(*set_arguments_v0) (struct gcc_base_context *self,
+ const char *triplet_regexp,
+ int argc, char **argv);
/* Set the file name of the program to compile. The string is
copied by the method implementation, but the caller must
@@ -93,18 +90,74 @@ struct gcc_base_vtable
const char *message),
void *datum);
- /* Perform the compilation. FILENAME is the name of the resulting
- object file. VERBOSE can be set to cause GCC to print some
- information as it works. Returns true on success, false on
- error. */
+ /* Deprecated GCC_FE_VERSION_0 variant of the GCC_FE_VERSION_1
+ compile method. GCC_FE_VERSION_0 version verbose parameter has
+ been replaced by the set_verbose method. */
- int /* bool */ (*compile) (struct gcc_base_context *self,
- const char *filename,
- int /* bool */ verbose);
+ int /* bool */ (*compile_v0) (struct gcc_base_context *self,
+ const char *filename,
+ int /* bool */ verbose);
/* Destroy this object. */
void (*destroy) (struct gcc_base_context *self);
+
+ /* VERBOSE can be set to non-zero to cause GCC to print some
+ information as it works. Calling this method overrides its
+ possible previous calls.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ void (*set_verbose) (struct gcc_base_context *self,
+ int /* bool */ verbose);
+
+ /* Perform the compilation. FILENAME is the name of the resulting
+ object file. Either set_triplet_regexp or set_driver_filename must
+ be called before. Returns true on success, false on error.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ int /* bool */ (*compile) (struct gcc_base_context *self,
+ const char *filename);
+
+ /* Set the compiler's command-line options for the next compilation.
+ The arguments are copied by GCC. ARGV need not be
+ NULL-terminated. The arguments must be set separately for each
+ compilation; that is, after a compile is requested, the
+ previously-set arguments cannot be reused.
+
+ This returns NULL on success. On failure, returns a malloc()d
+ error message. The caller is responsible for freeing it.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ char *(*set_arguments) (struct gcc_base_context *self,
+ int argc, char **argv);
+
+ /* Set TRIPLET_REGEXP as a regular expression that is used to match
+ the configury triplet prefix to the compiler. Calling this method
+ overrides possible previous call of itself or set_driver_filename.
+
+ This returns NULL on success. On failure, returns a malloc()d
+ error message. The caller is responsible for freeing it.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ char *(*set_triplet_regexp) (struct gcc_base_context *self,
+ const char *triplet_regexp);
+
+ /* DRIVER_FILENAME should be filename of the gcc compiler driver
+ program. It will be searched in PATH components like
+ TRIPLET_REGEXP. Calling this method overrides possible previous
+ call of itself or set_triplet_regexp.
+
+ This returns NULL on success. On failure, returns a malloc()d
+ error message. The caller is responsible for freeing it.
+
+ This method is only available since GCC_FE_VERSION_1. */
+
+ char *(*set_driver_filename) (struct gcc_base_context *self,
+ const char *driver_filename);
};
/* The GCC object. */
@@ -116,6 +169,20 @@ struct gcc_base_context
const struct gcc_base_vtable *ops;
};
+/* An array of types used for creating function types in multiple
+ languages. */
+
+struct gcc_type_array
+{
+ /* Number of elements. */
+
+ int n_elements;
+
+ /* The elements. */
+
+ gcc_type *elements;
+};
+
/* The name of the dummy wrapper function generated by gdb. */
#define GCC_FE_WRAPPER_FUNCTION "_gdb_expr"
diff --git a/include/gdb/gdb-index.h b/include/gdb/gdb-index.h
index 4e3d0a7544..38a5be954f 100644
--- a/include/gdb/gdb-index.h
+++ b/include/gdb/gdb-index.h
@@ -1,5 +1,5 @@
/* Public attributes of the .gdb_index section.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/include/getopt.h b/include/getopt.h
index 6f496b113c..d4cd55d97e 100644
--- a/include/getopt.h
+++ b/include/getopt.h
@@ -1,5 +1,5 @@
/* Declarations for getopt.
- Copyright (C) 1989-2015 Free Software Foundation, Inc.
+ Copyright (C) 1989-2017 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
diff --git a/include/gomp-constants.h b/include/gomp-constants.h
index e31c2e0036..87484f564a 100644
--- a/include/gomp-constants.h
+++ b/include/gomp-constants.h
@@ -1,6 +1,6 @@
/* Communication between GCC and libgomp.
- Copyright (C) 2014-2015 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
Contributed by Mentor Embedded.
@@ -196,8 +196,10 @@ enum gomp_map_kind
/* Internal to libgomp. */
#define GOMP_TARGET_FLAG_UPDATE (1U << 31)
-/* Versions of libgomp and device-specific plugins. */
-#define GOMP_VERSION 0
+/* Versions of libgomp and device-specific plugins. GOMP_VERSION
+ should be incremented whenever an ABI-incompatible change is introduced
+ to the plugin interface defined in libgomp/libgomp.h. */
+#define GOMP_VERSION 1
#define GOMP_VERSION_NVIDIA_PTX 1
#define GOMP_VERSION_INTEL_MIC 0
#define GOMP_VERSION_HSA 0
diff --git a/include/hashtab.h b/include/hashtab.h
index b1b5877aae..b5682f8210 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -1,5 +1,5 @@
/* An expandable hash tables datatype.
- Copyright (C) 1999-2015 Free Software Foundation, Inc.
+ Copyright (C) 1999-2017 Free Software Foundation, Inc.
Contributed by Vladimir Makarov (vmakarov@cygnus.com).
This program is free software; you can redistribute it and/or modify
diff --git a/include/hsa.h b/include/hsa.h
new file mode 100644
index 0000000000..9b9c826520
--- /dev/null
+++ b/include/hsa.h
@@ -0,0 +1,635 @@
+/* HSA runtime API 1.0.1 representation description.
+ Copyright (C) 2016-2017 Free Software Foundation, Inc.
+
+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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>.
+
+The contents of the file was created by extracting data structures, enum,
+typedef and other definitions from HSA Runtime Programmer’s Reference Manual
+Version 1.0 (http://www.hsafoundation.com/standards/).
+
+HTML version is provided on the following link:
+http://www.hsafoundation.com/html/Content/Runtime/Topics/Runtime_title_page.htm
+*/
+
+#ifndef _HSA_H
+#define _HSA_H 1
+
+#define HSA_LARGE_MODEL 1
+
+typedef struct hsa_signal_s { uint64_t handle; } hsa_signal_t;
+typedef enum {
+ HSA_QUEUE_TYPE_MULTI = 0,
+ HSA_QUEUE_TYPE_SINGLE = 1
+} hsa_queue_type_t;
+
+typedef enum { HSA_PROFILE_BASE = 0, HSA_PROFILE_FULL = 1 } hsa_profile_t;
+typedef struct hsa_region_s { uint64_t handle; } hsa_region_t;
+typedef enum {
+ HSA_EXECUTABLE_SYMBOL_INFO_TYPE = 0,
+ HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH = 1,
+ HSA_EXECUTABLE_SYMBOL_INFO_NAME = 2,
+ HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME_LENGTH = 3,
+ HSA_EXECUTABLE_SYMBOL_INFO_MODULE_NAME = 4,
+ HSA_EXECUTABLE_SYMBOL_INFO_AGENT = 20,
+ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ADDRESS = 21,
+ HSA_EXECUTABLE_SYMBOL_INFO_LINKAGE = 5,
+ HSA_EXECUTABLE_SYMBOL_INFO_IS_DEFINITION = 17,
+ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALLOCATION = 6,
+ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_SEGMENT = 7,
+ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_ALIGNMENT = 8,
+ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_SIZE = 9,
+ HSA_EXECUTABLE_SYMBOL_INFO_VARIABLE_IS_CONST = 10,
+ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_OBJECT = 22,
+ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE = 11,
+ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT = 12,
+ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE = 13,
+ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE = 14,
+ HSA_EXECUTABLE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK = 15,
+ HSA_EXECUTABLE_SYMBOL_INFO_INDIRECT_FUNCTION_OBJECT = 23,
+ HSA_EXECUTABLE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION = 16
+} hsa_executable_symbol_info_t;
+typedef enum {
+ HSA_REGION_GLOBAL_FLAG_KERNARG = 1,
+ HSA_REGION_GLOBAL_FLAG_FINE_GRAINED = 2,
+ HSA_REGION_GLOBAL_FLAG_COARSE_GRAINED = 4
+} hsa_region_global_flag_t;
+typedef struct hsa_code_object_s { uint64_t handle; } hsa_code_object_t;
+typedef enum {
+ HSA_KERNEL_DISPATCH_PACKET_SETUP_WIDTH_DIMENSIONS = 2
+} hsa_kernel_dispatch_packet_setup_width_t;
+typedef enum {
+ HSA_DEVICE_TYPE_CPU = 0,
+ HSA_DEVICE_TYPE_GPU = 1,
+ HSA_DEVICE_TYPE_DSP = 2
+} hsa_device_type_t;
+typedef enum {
+ HSA_STATUS_SUCCESS = 0x0,
+ HSA_STATUS_INFO_BREAK = 0x1,
+ HSA_STATUS_ERROR = 0x1000,
+ HSA_STATUS_ERROR_INVALID_ARGUMENT = 0x1001,
+ HSA_STATUS_ERROR_INVALID_QUEUE_CREATION = 0x1002,
+ HSA_STATUS_ERROR_INVALID_ALLOCATION = 0x1003,
+ HSA_STATUS_ERROR_INVALID_AGENT = 0x1004,
+ HSA_STATUS_ERROR_INVALID_REGION = 0x1005,
+ HSA_STATUS_ERROR_INVALID_SIGNAL = 0x1006,
+ HSA_STATUS_ERROR_INVALID_QUEUE = 0x1007,
+ HSA_STATUS_ERROR_OUT_OF_RESOURCES = 0x1008,
+ HSA_STATUS_ERROR_INVALID_PACKET_FORMAT = 0x1009,
+ HSA_STATUS_ERROR_RESOURCE_FREE = 0x100A,
+ HSA_STATUS_ERROR_NOT_INITIALIZED = 0x100B,
+ HSA_STATUS_ERROR_REFCOUNT_OVERFLOW = 0x100C,
+ HSA_STATUS_ERROR_INCOMPATIBLE_ARGUMENTS = 0x100D,
+ HSA_STATUS_ERROR_INVALID_INDEX = 0x100E,
+ HSA_STATUS_ERROR_INVALID_ISA = 0x100F,
+ HSA_STATUS_ERROR_INVALID_ISA_NAME = 0x1017,
+ HSA_STATUS_ERROR_INVALID_CODE_OBJECT = 0x1010,
+ HSA_STATUS_ERROR_INVALID_EXECUTABLE = 0x1011,
+ HSA_STATUS_ERROR_FROZEN_EXECUTABLE = 0x1012,
+ HSA_STATUS_ERROR_INVALID_SYMBOL_NAME = 0x1013,
+ HSA_STATUS_ERROR_VARIABLE_ALREADY_DEFINED = 0x1014,
+ HSA_STATUS_ERROR_VARIABLE_UNDEFINED = 0x1015,
+ HSA_STATUS_ERROR_EXCEPTION = 0x1016
+} hsa_status_t;
+typedef enum {
+ HSA_EXTENSION_FINALIZER = 0,
+ HSA_EXTENSION_IMAGES = 1
+} hsa_extension_t;
+typedef struct hsa_queue_s {
+ hsa_queue_type_t type;
+ uint32_t features;
+
+#ifdef HSA_LARGE_MODEL
+ void *base_address;
+#elif defined HSA_LITTLE_ENDIAN
+ void *base_address;
+ uint32_t reserved0;
+#else
+ uint32_t reserved0;
+ void *base_address;
+#endif
+
+ hsa_signal_t doorbell_signal;
+ uint32_t size;
+ uint32_t reserved1;
+ uint64_t id;
+} hsa_queue_t;
+typedef struct hsa_agent_dispatch_packet_s {
+ uint16_t header;
+ uint16_t type;
+ uint32_t reserved0;
+
+#ifdef HSA_LARGE_MODEL
+ void *return_address;
+#elif defined HSA_LITTLE_ENDIAN
+ void *return_address;
+ uint32_t reserved1;
+#else
+ uint32_t reserved1;
+ void *return_address;
+#endif
+ uint64_t arg[4];
+ uint64_t reserved2;
+ hsa_signal_t completion_signal;
+} hsa_agent_dispatch_packet_t;
+typedef enum {
+ HSA_CODE_SYMBOL_INFO_TYPE = 0,
+ HSA_CODE_SYMBOL_INFO_NAME_LENGTH = 1,
+ HSA_CODE_SYMBOL_INFO_NAME = 2,
+ HSA_CODE_SYMBOL_INFO_MODULE_NAME_LENGTH = 3,
+ HSA_CODE_SYMBOL_INFO_MODULE_NAME = 4,
+ HSA_CODE_SYMBOL_INFO_LINKAGE = 5,
+ HSA_CODE_SYMBOL_INFO_IS_DEFINITION = 17,
+ HSA_CODE_SYMBOL_INFO_VARIABLE_ALLOCATION = 6,
+ HSA_CODE_SYMBOL_INFO_VARIABLE_SEGMENT = 7,
+ HSA_CODE_SYMBOL_INFO_VARIABLE_ALIGNMENT = 8,
+ HSA_CODE_SYMBOL_INFO_VARIABLE_SIZE = 9,
+ HSA_CODE_SYMBOL_INFO_VARIABLE_IS_CONST = 10,
+ HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_SIZE = 11,
+ HSA_CODE_SYMBOL_INFO_KERNEL_KERNARG_SEGMENT_ALIGNMENT = 12,
+ HSA_CODE_SYMBOL_INFO_KERNEL_GROUP_SEGMENT_SIZE = 13,
+ HSA_CODE_SYMBOL_INFO_KERNEL_PRIVATE_SEGMENT_SIZE = 14,
+ HSA_CODE_SYMBOL_INFO_KERNEL_DYNAMIC_CALLSTACK = 15,
+ HSA_CODE_SYMBOL_INFO_INDIRECT_FUNCTION_CALL_CONVENTION = 16
+} hsa_code_symbol_info_t;
+typedef enum {
+ HSA_QUEUE_FEATURE_KERNEL_DISPATCH = 1,
+ HSA_QUEUE_FEATURE_AGENT_DISPATCH = 2
+} hsa_queue_feature_t;
+typedef enum {
+ HSA_VARIABLE_ALLOCATION_AGENT = 0,
+ HSA_VARIABLE_ALLOCATION_PROGRAM = 1
+} hsa_variable_allocation_t;
+typedef enum {
+ HSA_FENCE_SCOPE_NONE = 0,
+ HSA_FENCE_SCOPE_AGENT = 1,
+ HSA_FENCE_SCOPE_SYSTEM = 2
+} hsa_fence_scope_t;
+typedef struct hsa_agent_s { uint64_t handle; } hsa_agent_t;
+typedef enum { HSA_CODE_OBJECT_TYPE_PROGRAM = 0 } hsa_code_object_type_t;
+typedef enum {
+ HSA_SIGNAL_CONDITION_EQ = 0,
+ HSA_SIGNAL_CONDITION_NE = 1,
+ HSA_SIGNAL_CONDITION_LT = 2,
+ HSA_SIGNAL_CONDITION_GTE = 3
+} hsa_signal_condition_t;
+typedef enum {
+ HSA_EXECUTABLE_STATE_UNFROZEN = 0,
+ HSA_EXECUTABLE_STATE_FROZEN = 1
+} hsa_executable_state_t;
+typedef enum {
+ HSA_ENDIANNESS_LITTLE = 0,
+ HSA_ENDIANNESS_BIG = 1
+} hsa_endianness_t;
+typedef enum {
+ HSA_MACHINE_MODEL_SMALL = 0,
+ HSA_MACHINE_MODEL_LARGE = 1
+} hsa_machine_model_t;
+typedef enum {
+ HSA_AGENT_INFO_NAME = 0,
+ HSA_AGENT_INFO_VENDOR_NAME = 1,
+ HSA_AGENT_INFO_FEATURE = 2,
+ HSA_AGENT_INFO_MACHINE_MODEL = 3,
+ HSA_AGENT_INFO_PROFILE = 4,
+ HSA_AGENT_INFO_DEFAULT_FLOAT_ROUNDING_MODE = 5,
+ HSA_AGENT_INFO_BASE_PROFILE_DEFAULT_FLOAT_ROUNDING_MODES = 23,
+ HSA_AGENT_INFO_FAST_F16_OPERATION = 24,
+ HSA_AGENT_INFO_WAVEFRONT_SIZE = 6,
+ HSA_AGENT_INFO_WORKGROUP_MAX_DIM = 7,
+ HSA_AGENT_INFO_WORKGROUP_MAX_SIZE = 8,
+ HSA_AGENT_INFO_GRID_MAX_DIM = 9,
+ HSA_AGENT_INFO_GRID_MAX_SIZE = 10,
+ HSA_AGENT_INFO_FBARRIER_MAX_SIZE = 11,
+ HSA_AGENT_INFO_QUEUES_MAX = 12,
+ HSA_AGENT_INFO_QUEUE_MIN_SIZE = 13,
+ HSA_AGENT_INFO_QUEUE_MAX_SIZE = 14,
+ HSA_AGENT_INFO_QUEUE_TYPE = 15,
+ HSA_AGENT_INFO_NODE = 16,
+ HSA_AGENT_INFO_DEVICE = 17,
+ HSA_AGENT_INFO_CACHE_SIZE = 18,
+ HSA_AGENT_INFO_ISA = 19,
+ HSA_AGENT_INFO_EXTENSIONS = 20,
+ HSA_AGENT_INFO_VERSION_MAJOR = 21,
+ HSA_AGENT_INFO_VERSION_MINOR = 22
+} hsa_agent_info_t;
+typedef struct hsa_barrier_and_packet_s {
+ uint16_t header;
+ uint16_t reserved0;
+ uint32_t reserved1;
+ hsa_signal_t dep_signal[5];
+ uint64_t reserved2;
+ hsa_signal_t completion_signal;
+} hsa_barrier_and_packet_t;
+typedef struct hsa_dim3_s {
+ uint32_t x;
+ uint32_t y;
+ uint32_t z;
+} hsa_dim3_t;
+typedef enum {
+ HSA_ACCESS_PERMISSION_RO = 1,
+ HSA_ACCESS_PERMISSION_WO = 2,
+ HSA_ACCESS_PERMISSION_RW = 3
+} hsa_access_permission_t;
+typedef enum {
+ HSA_AGENT_FEATURE_KERNEL_DISPATCH = 1,
+ HSA_AGENT_FEATURE_AGENT_DISPATCH = 2
+} hsa_agent_feature_t;
+typedef enum {
+ HSA_WAIT_STATE_BLOCKED = 0,
+ HSA_WAIT_STATE_ACTIVE = 1
+} hsa_wait_state_t;
+typedef struct hsa_executable_s { uint64_t handle; } hsa_executable_t;
+typedef enum {
+ HSA_REGION_SEGMENT_GLOBAL = 0,
+ HSA_REGION_SEGMENT_READONLY = 1,
+ HSA_REGION_SEGMENT_PRIVATE = 2,
+ HSA_REGION_SEGMENT_GROUP = 3
+} hsa_region_segment_t;
+typedef enum {
+ HSA_REGION_INFO_SEGMENT = 0,
+ HSA_REGION_INFO_GLOBAL_FLAGS = 1,
+ HSA_REGION_INFO_SIZE = 2,
+ HSA_REGION_INFO_ALLOC_MAX_SIZE = 4,
+ HSA_REGION_INFO_RUNTIME_ALLOC_ALLOWED = 5,
+ HSA_REGION_INFO_RUNTIME_ALLOC_GRANULE = 6,
+ HSA_REGION_INFO_RUNTIME_ALLOC_ALIGNMENT = 7
+} hsa_region_info_t;
+typedef enum {
+ HSA_ISA_INFO_NAME_LENGTH = 0,
+ HSA_ISA_INFO_NAME = 1,
+ HSA_ISA_INFO_CALL_CONVENTION_COUNT = 2,
+ HSA_ISA_INFO_CALL_CONVENTION_INFO_WAVEFRONT_SIZE = 3,
+ HSA_ISA_INFO_CALL_CONVENTION_INFO_WAVEFRONTS_PER_COMPUTE_UNIT = 4
+} hsa_isa_info_t;
+typedef enum {
+ HSA_VARIABLE_SEGMENT_GLOBAL = 0,
+ HSA_VARIABLE_SEGMENT_READONLY = 1
+} hsa_variable_segment_t;
+typedef struct hsa_callback_data_s { uint64_t handle; } hsa_callback_data_t;
+typedef enum {
+ HSA_SYMBOL_KIND_VARIABLE = 0,
+ HSA_SYMBOL_KIND_KERNEL = 1,
+ HSA_SYMBOL_KIND_INDIRECT_FUNCTION = 2
+} hsa_symbol_kind_t;
+typedef struct hsa_kernel_dispatch_packet_s {
+ uint16_t header;
+ uint16_t setup;
+ uint16_t workgroup_size_x;
+ uint16_t workgroup_size_y;
+ uint16_t workgroup_size_z;
+ uint16_t reserved0;
+ uint32_t grid_size_x;
+ uint32_t grid_size_y;
+ uint32_t grid_size_z;
+ uint32_t private_segment_size;
+ uint32_t group_segment_size;
+ uint64_t kernel_object;
+
+#ifdef HSA_LARGE_MODEL
+ void *kernarg_address;
+#elif defined HSA_LITTLE_ENDIAN
+ void *kernarg_address;
+ uint32_t reserved1;
+#else
+ uint32_t reserved1;
+ void *kernarg_address;
+#endif
+ uint64_t reserved2;
+ hsa_signal_t completion_signal;
+} hsa_kernel_dispatch_packet_t;
+typedef enum {
+ HSA_PACKET_TYPE_VENDOR_SPECIFIC = 0,
+ HSA_PACKET_TYPE_INVALID = 1,
+ HSA_PACKET_TYPE_KERNEL_DISPATCH = 2,
+ HSA_PACKET_TYPE_BARRIER_AND = 3,
+ HSA_PACKET_TYPE_AGENT_DISPATCH = 4,
+ HSA_PACKET_TYPE_BARRIER_OR = 5
+} hsa_packet_type_t;
+typedef enum {
+ HSA_PACKET_HEADER_TYPE = 0,
+ HSA_PACKET_HEADER_BARRIER = 8,
+ HSA_PACKET_HEADER_ACQUIRE_FENCE_SCOPE = 9,
+ HSA_PACKET_HEADER_RELEASE_FENCE_SCOPE = 11
+} hsa_packet_header_t;
+typedef struct hsa_isa_s { uint64_t handle; } hsa_isa_t;
+typedef enum {
+ HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT = 0,
+ HSA_DEFAULT_FLOAT_ROUNDING_MODE_ZERO = 1,
+ HSA_DEFAULT_FLOAT_ROUNDING_MODE_NEAR = 2
+} hsa_default_float_rounding_mode_t;
+typedef struct hsa_code_symbol_s { uint64_t handle; } hsa_code_symbol_t;
+typedef struct hsa_executable_symbol_s {
+ uint64_t handle;
+} hsa_executable_symbol_t;
+#ifdef HSA_LARGE_MODEL
+typedef int64_t hsa_signal_value_t;
+#else
+typedef int32_t hsa_signal_value_t;
+#endif
+typedef enum {
+ HSA_EXCEPTION_POLICY_BREAK = 1,
+ HSA_EXCEPTION_POLICY_DETECT = 2
+} hsa_exception_policy_t;
+typedef enum {
+ HSA_SYSTEM_INFO_VERSION_MAJOR = 0,
+ HSA_SYSTEM_INFO_VERSION_MINOR = 1,
+ HSA_SYSTEM_INFO_TIMESTAMP = 2,
+ HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY = 3,
+ HSA_SYSTEM_INFO_SIGNAL_MAX_WAIT = 4,
+ HSA_SYSTEM_INFO_ENDIANNESS = 5,
+ HSA_SYSTEM_INFO_MACHINE_MODEL = 6,
+ HSA_SYSTEM_INFO_EXTENSIONS = 7
+} hsa_system_info_t;
+typedef enum {
+ HSA_EXECUTABLE_INFO_PROFILE = 1,
+ HSA_EXECUTABLE_INFO_STATE = 2
+} hsa_executable_info_t;
+typedef enum {
+ HSA_KERNEL_DISPATCH_PACKET_SETUP_DIMENSIONS = 0
+} hsa_kernel_dispatch_packet_setup_t;
+typedef enum {
+ HSA_PACKET_HEADER_WIDTH_TYPE = 8,
+ HSA_PACKET_HEADER_WIDTH_BARRIER = 1,
+ HSA_PACKET_HEADER_WIDTH_ACQUIRE_FENCE_SCOPE = 2,
+ HSA_PACKET_HEADER_WIDTH_RELEASE_FENCE_SCOPE = 2
+} hsa_packet_header_width_t;
+typedef enum {
+ HSA_CODE_OBJECT_INFO_VERSION = 0,
+ HSA_CODE_OBJECT_INFO_TYPE = 1,
+ HSA_CODE_OBJECT_INFO_ISA = 2,
+ HSA_CODE_OBJECT_INFO_MACHINE_MODEL = 3,
+ HSA_CODE_OBJECT_INFO_PROFILE = 4,
+ HSA_CODE_OBJECT_INFO_DEFAULT_FLOAT_ROUNDING_MODE = 5
+} hsa_code_object_info_t;
+typedef struct hsa_barrier_or_packet_s {
+ uint16_t header;
+ uint16_t reserved0;
+ uint32_t reserved1;
+ hsa_signal_t dep_signal[5];
+ uint64_t reserved2;
+ hsa_signal_t completion_signal;
+} hsa_barrier_or_packet_t;
+typedef enum {
+ HSA_SYMBOL_KIND_LINKAGE_MODULE = 0,
+ HSA_SYMBOL_KIND_LINKAGE_PROGRAM = 1,
+} hsa_symbol_kind_linkage_t;
+hsa_status_t hsa_executable_validate(hsa_executable_t executable,
+ uint32_t *result);
+uint64_t hsa_queue_add_write_index_acq_rel(const hsa_queue_t *queue,
+ uint64_t value);
+
+uint64_t hsa_queue_add_write_index_acquire(const hsa_queue_t *queue,
+ uint64_t value);
+
+uint64_t hsa_queue_add_write_index_relaxed(const hsa_queue_t *queue,
+ uint64_t value);
+
+uint64_t hsa_queue_add_write_index_release(const hsa_queue_t *queue,
+ uint64_t value);
+hsa_status_t hsa_shut_down();
+void hsa_signal_add_acq_rel(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_add_acquire(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_add_relaxed(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_add_release(hsa_signal_t signal, hsa_signal_value_t value);
+hsa_status_t hsa_executable_readonly_variable_define(
+ hsa_executable_t executable, hsa_agent_t agent, const char *variable_name,
+ void *address);
+hsa_status_t hsa_agent_extension_supported(uint16_t extension,
+ hsa_agent_t agent,
+ uint16_t version_major,
+ uint16_t version_minor,
+ bool *result);
+hsa_signal_value_t hsa_signal_load_acquire(hsa_signal_t signal);
+
+hsa_signal_value_t hsa_signal_load_relaxed(hsa_signal_t signal);
+hsa_status_t hsa_executable_get_info(hsa_executable_t executable,
+ hsa_executable_info_t attribute,
+ void *value);
+hsa_status_t hsa_iterate_agents(hsa_status_t (*callback)(hsa_agent_t agent,
+ void *data),
+ void *data);
+void hsa_signal_subtract_acq_rel(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_subtract_acquire(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_subtract_relaxed(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_subtract_release(hsa_signal_t signal, hsa_signal_value_t value);
+hsa_status_t
+hsa_executable_symbol_get_info(hsa_executable_symbol_t executable_symbol,
+ hsa_executable_symbol_info_t attribute,
+ void *value);
+void hsa_signal_xor_acq_rel(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_xor_acquire(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_xor_relaxed(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_xor_release(hsa_signal_t signal, hsa_signal_value_t value);
+hsa_status_t hsa_code_object_get_info(hsa_code_object_t code_object,
+ hsa_code_object_info_t attribute,
+ void *value);
+hsa_status_t hsa_code_object_deserialize(void *serialized_code_object,
+ size_t serialized_code_object_size,
+ const char *options,
+ hsa_code_object_t *code_object);
+hsa_status_t hsa_status_string(hsa_status_t status, const char **status_string);
+hsa_status_t hsa_code_object_get_symbol(hsa_code_object_t code_object,
+ const char *symbol_name,
+ hsa_code_symbol_t *symbol);
+void hsa_signal_store_relaxed(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_store_release(hsa_signal_t signal, hsa_signal_value_t value);
+hsa_status_t hsa_signal_destroy(hsa_signal_t signal);
+hsa_status_t hsa_system_get_extension_table(uint16_t extension,
+ uint16_t version_major,
+ uint16_t version_minor,
+ void *table);
+hsa_status_t hsa_agent_iterate_regions(
+ hsa_agent_t agent,
+ hsa_status_t (*callback)(hsa_region_t region, void *data), void *data);
+hsa_status_t hsa_executable_agent_global_variable_define(
+ hsa_executable_t executable, hsa_agent_t agent, const char *variable_name,
+ void *address);
+hsa_status_t hsa_queue_create(hsa_agent_t agent, uint32_t size,
+ hsa_queue_type_t type,
+ void (*callback)(hsa_status_t status,
+ hsa_queue_t *source, void *data),
+ void *data, uint32_t private_segment_size,
+ uint32_t group_segment_size, hsa_queue_t **queue);
+hsa_status_t hsa_isa_compatible(hsa_isa_t code_object_isa, hsa_isa_t agent_isa,
+ bool *result);
+hsa_status_t hsa_code_object_serialize(
+ hsa_code_object_t code_object,
+ hsa_status_t (*alloc_callback)(size_t size, hsa_callback_data_t data,
+ void **address),
+ hsa_callback_data_t callback_data, const char *options,
+ void **serialized_code_object, size_t *serialized_code_object_size);
+hsa_status_t hsa_region_get_info(hsa_region_t region,
+ hsa_region_info_t attribute, void *value);
+hsa_status_t hsa_executable_freeze(hsa_extension_t executable,
+ const char *options);
+hsa_status_t hsa_system_extension_supported(uint16_t extension,
+ uint16_t version_major,
+ uint16_t version_minor,
+ bool *result);
+hsa_signal_value_t hsa_signal_wait_acquire(hsa_signal_t signal,
+ hsa_signal_condition_t condition,
+ hsa_signal_value_t compare_value,
+ uint64_t timeout_hint,
+ hsa_wait_state_t wait_state_hint);
+
+hsa_signal_value_t hsa_signal_wait_relaxed(hsa_signal_t signal,
+ hsa_signal_condition_t condition,
+ hsa_signal_value_t compare_value,
+ uint64_t timeout_hint,
+ hsa_wait_state_t wait_state_hint);
+hsa_status_t hsa_memory_copy(void *dst, const void *src, size_t size);
+hsa_status_t hsa_memory_free(void *ptr);
+hsa_status_t hsa_queue_destroy(hsa_queue_t *queue);
+hsa_status_t hsa_isa_from_name(const char *name, hsa_isa_t *isa);
+hsa_status_t hsa_isa_get_info(hsa_isa_t isa, hsa_isa_info_t attribute,
+ uint32_t index, void *value);
+hsa_status_t hsa_signal_create(hsa_signal_value_t initial_value,
+ uint32_t num_consumers,
+ const hsa_agent_t *consumers,
+ hsa_signal_t *signal);
+hsa_status_t hsa_code_symbol_get_info(hsa_code_symbol_t code_symbol,
+ hsa_code_symbol_info_t attribute,
+ void *value);
+hsa_signal_value_t hsa_signal_cas_acq_rel(hsa_signal_t signal,
+ hsa_signal_value_t expected,
+ hsa_signal_value_t value);
+
+hsa_signal_value_t hsa_signal_cas_acquire(hsa_signal_t signal,
+ hsa_signal_value_t expected,
+ hsa_signal_value_t value);
+
+hsa_signal_value_t hsa_signal_cas_relaxed(hsa_signal_t signal,
+ hsa_signal_value_t expected,
+ hsa_signal_value_t value);
+
+hsa_signal_value_t hsa_signal_cas_release(hsa_signal_t signal,
+ hsa_signal_value_t expected,
+ hsa_signal_value_t value);
+hsa_status_t hsa_code_object_iterate_symbols(
+ hsa_code_object_t code_object,
+ hsa_status_t (*callback)(hsa_code_object_t code_object,
+ hsa_code_symbol_t symbol, void *data),
+ void *data);
+void hsa_queue_store_read_index_relaxed(const hsa_queue_t *queue,
+ uint64_t value);
+
+void hsa_queue_store_read_index_release(const hsa_queue_t *queue,
+ uint64_t value);
+hsa_status_t hsa_memory_assign_agent(void *ptr, hsa_agent_t agent,
+ hsa_access_permission_t access);
+hsa_status_t hsa_queue_inactivate(hsa_queue_t *queue);
+hsa_status_t hsa_executable_get_symbol(hsa_executable_t executable,
+ const char *module_name,
+ const char *symbol_name,
+ hsa_agent_t agent,
+ int32_t call_convention,
+ hsa_executable_symbol_t *symbol);
+uint64_t hsa_queue_cas_write_index_acq_rel(const hsa_queue_t *queue,
+ uint64_t expected, uint64_t value);
+
+uint64_t hsa_queue_cas_write_index_acquire(const hsa_queue_t *queue,
+ uint64_t expected, uint64_t value);
+
+uint64_t hsa_queue_cas_write_index_relaxed(const hsa_queue_t *queue,
+ uint64_t expected, uint64_t value);
+
+uint64_t hsa_queue_cas_write_index_release(const hsa_queue_t *queue,
+ uint64_t expected, uint64_t value);
+void hsa_signal_and_acq_rel(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_and_acquire(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_and_relaxed(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_and_release(hsa_signal_t signal, hsa_signal_value_t value);
+uint64_t hsa_queue_load_read_index_acquire(const hsa_queue_t *queue);
+
+uint64_t hsa_queue_load_read_index_relaxed(const hsa_queue_t *queue);
+hsa_status_t hsa_executable_load_code_object(hsa_executable_t executable,
+ hsa_agent_t agent,
+ hsa_code_object_t code_object,
+ const char *options);
+uint64_t hsa_queue_load_write_index_acquire(const hsa_queue_t *queue);
+
+uint64_t hsa_queue_load_write_index_relaxed(const hsa_queue_t *queue);
+hsa_status_t hsa_agent_get_exception_policies(hsa_agent_t agent,
+ hsa_profile_t profile,
+ uint16_t *mask);
+hsa_status_t hsa_memory_deregister(void *ptr, size_t size);
+void hsa_signal_or_acq_rel(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_or_acquire(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_or_relaxed(hsa_signal_t signal, hsa_signal_value_t value);
+
+void hsa_signal_or_release(hsa_signal_t signal, hsa_signal_value_t value);
+hsa_status_t hsa_soft_queue_create(hsa_region_t region, uint32_t size,
+ hsa_queue_type_t type, uint32_t features,
+ hsa_signal_t doorbell_signal,
+ hsa_queue_t **queue);
+hsa_status_t hsa_executable_iterate_symbols(
+ hsa_executable_t executable,
+ hsa_status_t (*callback)(hsa_executable_t executable,
+ hsa_executable_symbol_t symbol, void *data),
+ void *data);
+hsa_status_t hsa_memory_register(void *ptr, size_t size);
+void hsa_queue_store_write_index_relaxed(const hsa_queue_t *queue,
+ uint64_t value);
+
+void hsa_queue_store_write_index_release(const hsa_queue_t *queue,
+ uint64_t value);
+hsa_status_t hsa_executable_global_variable_define(hsa_executable_t executable,
+ const char *variable_name,
+ void *address);
+hsa_status_t hsa_executable_destroy(hsa_executable_t executable);
+hsa_status_t hsa_code_object_destroy(hsa_code_object_t code_object);
+hsa_status_t hsa_memory_allocate(hsa_region_t region, size_t size, void **ptr);
+hsa_signal_value_t hsa_signal_exchange_acq_rel(hsa_signal_t signal,
+ hsa_signal_value_t value);
+
+hsa_signal_value_t hsa_signal_exchange_acquire(hsa_signal_t signal,
+ hsa_signal_value_t value);
+
+hsa_signal_value_t hsa_signal_exchange_relaxed(hsa_signal_t signal,
+ hsa_signal_value_t value);
+
+hsa_signal_value_t hsa_signal_exchange_release(hsa_signal_t signal,
+ hsa_signal_value_t value);
+hsa_status_t hsa_agent_get_info(hsa_agent_t agent, hsa_agent_info_t attribute,
+ void *value);
+hsa_status_t hsa_init();
+hsa_status_t hsa_system_get_info(hsa_system_info_t attribute, void *value);
+hsa_status_t hsa_executable_create(hsa_profile_t profile,
+ hsa_executable_state_t executable_state,
+ const char *options,
+ hsa_executable_t *executable);
+
+#endif /* _HSA_H */
diff --git a/include/leb128.h b/include/leb128.h
index 56016b0f77..5cd6c5c051 100644
--- a/include/leb128.h
+++ b/include/leb128.h
@@ -1,5 +1,5 @@
/* Utilities for reading leb128 values.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
diff --git a/include/libiberty.h b/include/libiberty.h
index a9c885fc67..7a796124bf 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -1,6 +1,6 @@
/* Function declarations for libiberty.
- Copyright (C) 1997-2015 Free Software Foundation, Inc.
+ Copyright (C) 1997-2017 Free Software Foundation, Inc.
Note - certain prototypes declared in this header file are for
functions whoes implementation copyright does not belong to the
@@ -397,6 +397,17 @@ extern void hex_init (void);
/* Save files used for communication between processes. */
#define PEX_SAVE_TEMPS 0x4
+/* Max number of alloca bytes per call before we must switch to malloc.
+
+ ?? Swiped from gnulib's regex_internal.h header. Is this actually
+ the case? This number seems arbitrary, though sane.
+
+ The OS usually guarantees only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ allocate anything larger than 4096 bytes. Also care for the possibility
+ of a few compiler-allocated temporary stack slots. */
+#define MAX_ALLOCA_SIZE 4032
+
/* Prepare to execute one or more programs, with standard output of
each program fed to standard input of the next.
FLAGS As above.
diff --git a/include/longlong.h b/include/longlong.h
index 34ad9b4f57..9d3ab21be2 100644
--- a/include/longlong.h
+++ b/include/longlong.h
@@ -1,5 +1,5 @@
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
- Copyright (C) 1991-2015 Free Software Foundation, Inc.
+ Copyright (C) 1991-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -197,17 +197,17 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype);
: "=r" ((USItype) (sh)), \
"=&r" ((USItype) (sl)) \
: "%r" ((USItype) (ah)), \
- "rIJ" ((USItype) (bh)), \
+ "rICal" ((USItype) (bh)), \
"%r" ((USItype) (al)), \
- "rIJ" ((USItype) (bl)))
+ "rICal" ((USItype) (bl)))
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
__asm__ ("sub.f %1, %4, %5\n\tsbc %0, %2, %3" \
: "=r" ((USItype) (sh)), \
"=&r" ((USItype) (sl)) \
: "r" ((USItype) (ah)), \
- "rIJ" ((USItype) (bh)), \
+ "rICal" ((USItype) (bh)), \
"r" ((USItype) (al)), \
- "rIJ" ((USItype) (bl)))
+ "rICal" ((USItype) (bl)))
#define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
#ifdef __ARC_NORM__
@@ -221,8 +221,8 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype);
} \
while (0)
#define COUNT_LEADING_ZEROS_0 32
-#endif
-#endif
+#endif /* __ARC_NORM__ */
+#endif /* __arc__ */
#if defined (__arm__) && (defined (__thumb2__) || !defined (__thumb__)) \
&& W_TYPE_SIZE == 32
@@ -1086,7 +1086,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
} while (0)
#endif
-#if defined(__sh__) && (!defined (__SHMEDIA__) || !__SHMEDIA__) && W_TYPE_SIZE == 32
+#if defined(__sh__) && W_TYPE_SIZE == 32
#ifndef __sh1__
#define umul_ppmm(w1, w0, u, v) \
__asm__ ( \
@@ -1159,21 +1159,6 @@ extern UDItype __umulsidi3 (USItype, USItype);
#endif /* __sh__ */
-#if defined (__SH5__) && defined (__SHMEDIA__) && __SHMEDIA__ && W_TYPE_SIZE == 32
-#define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
-#define count_leading_zeros(count, x) \
- do \
- { \
- UDItype x_ = (USItype)(x); \
- SItype c_; \
- \
- __asm__ ("nsb %1, %0" : "=r" (c_) : "r" (x_)); \
- (count) = c_ - 31; \
- } \
- while (0)
-#define COUNT_LEADING_ZEROS_0 32
-#endif
-
#if defined (__sparc__) && !defined (__arch64__) && !defined (__sparcv9) \
&& W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
diff --git a/include/lto-symtab.h b/include/lto-symtab.h
index 878d0502c9..5889e74d65 100644
--- a/include/lto-symtab.h
+++ b/include/lto-symtab.h
@@ -1,5 +1,5 @@
/* Data types used in the IL symbol table.
- Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ Copyright (C) 2009-2017 Free Software Foundation, Inc.
Contributed by Rafael Espindola <espindola@google.com>
This file is part of GCC.
diff --git a/include/md5.h b/include/md5.h
index 909f7b4df1..2188677077 100644
--- a/include/md5.h
+++ b/include/md5.h
@@ -1,6 +1,6 @@
/* md5.h - Declaration of functions and data types used for MD5 sum
computing library functions.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2017 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
diff --git a/include/objalloc.h b/include/objalloc.h
index 2c06350908..657ca6ee79 100644
--- a/include/objalloc.h
+++ b/include/objalloc.h
@@ -1,5 +1,5 @@
/* objalloc.h -- routines to allocate memory for objects
- Copyright (C) 1997-2015 Free Software Foundation, Inc.
+ Copyright (C) 1997-2017 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Solutions.
This program is free software; you can redistribute it and/or modify it
diff --git a/include/obstack.h b/include/obstack.h
index 0d13c72d05..2afd55d8e6 100644
--- a/include/obstack.h
+++ b/include/obstack.h
@@ -1,5 +1,5 @@
/* obstack.h - object stack macros
- Copyright (C) 1988-2015 Free Software Foundation, Inc.
+ Copyright (C) 1988-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/include/partition.h b/include/partition.h
index c39873b601..0f2c3eb600 100644
--- a/include/partition.h
+++ b/include/partition.h
@@ -1,5 +1,5 @@
/* List implementation of a partition of consecutive integers.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000-2017 Free Software Foundation, Inc.
Contributed by CodeSourcery, LLC.
This file is part of GCC.
diff --git a/include/plugin-api.h b/include/plugin-api.h
index a794a37049..3a3e8b456d 100644
--- a/include/plugin-api.h
+++ b/include/plugin-api.h
@@ -1,6 +1,6 @@
/* plugin-api.h -- External linker plugin API. */
-/* Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2017 Free Software Foundation, Inc.
Written by Cary Coutant <ccoutant@google.com>.
This file is part of binutils.
diff --git a/include/safe-ctype.h b/include/safe-ctype.h
index a6d163e6e2..16d8ebf371 100644
--- a/include/safe-ctype.h
+++ b/include/safe-ctype.h
@@ -1,6 +1,6 @@
/* <ctype.h> replacement macros.
- Copyright (C) 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 2000-2017 Free Software Foundation, Inc.
Contributed by Zack Weinberg <zackw@stanford.edu>.
This file is part of the libiberty library.
diff --git a/include/sha1.h b/include/sha1.h
index 24f3ab79dc..2b470730d5 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -1,6 +1,6 @@
/* Declarations of functions and data types used for SHA1 sum
library functions.
- Copyright (C) 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 2000-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
diff --git a/include/simple-object.h b/include/simple-object.h
index 5bd3d06c1e..8a8439bdb1 100644
--- a/include/simple-object.h
+++ b/include/simple-object.h
@@ -1,5 +1,5 @@
/* simple-object.h -- simple routines to read and write object files
- Copyright (C) 2010-2015 Free Software Foundation, Inc.
+ Copyright (C) 2010-2017 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Google.
This program is free software; you can redistribute it and/or modify it
diff --git a/include/sort.h b/include/sort.h
index 23025d431b..4e29094ceb 100644
--- a/include/sort.h
+++ b/include/sort.h
@@ -1,5 +1,5 @@
/* Sorting algorithms.
- Copyright (C) 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 2000-2017 Free Software Foundation, Inc.
Contributed by Mark Mitchell <mark@codesourcery.com>.
This file is part of GCC.
diff --git a/include/splay-tree.h b/include/splay-tree.h
index f71d7d7b6f..d8210f0302 100644
--- a/include/splay-tree.h
+++ b/include/splay-tree.h
@@ -1,5 +1,5 @@
/* A splay-tree datatype.
- Copyright (C) 1998-2015 Free Software Foundation, Inc.
+ Copyright (C) 1998-2017 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GCC.
diff --git a/include/symcat.h b/include/symcat.h
index 95fc9b2c55..186c1561bf 100644
--- a/include/symcat.h
+++ b/include/symcat.h
@@ -1,6 +1,6 @@
/* Symbol concatenation utilities.
- Copyright (C) 1998-2015 Free Software Foundation, Inc.
+ Copyright (C) 1998-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/timeval-utils.h b/include/timeval-utils.h
index adbe8183fe..7e300b314f 100644
--- a/include/timeval-utils.h
+++ b/include/timeval-utils.h
@@ -1,5 +1,5 @@
/* Basic struct timeval utilities.
- Copyright (C) 2011-2015 Free Software Foundation, Inc.
+ Copyright (C) 2011-2017 Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
diff --git a/include/vtv-change-permission.h b/include/vtv-change-permission.h
index 04ad8c3db6..a36c29104d 100644
--- a/include/vtv-change-permission.h
+++ b/include/vtv-change-permission.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2017 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/include/xregex2.h b/include/xregex2.h
index 05066d4b28..2e46720ea2 100644
--- a/include/xregex2.h
+++ b/include/xregex2.h
@@ -1,7 +1,7 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
- Copyright (C) 1985-2015 Free Software Foundation, Inc.
+ Copyright (C) 1985-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
diff --git a/include/xtensa-config.h b/include/xtensa-config.h
index 5ae4c8060b..ca68c0d065 100644
--- a/include/xtensa-config.h
+++ b/include/xtensa-config.h
@@ -1,5 +1,5 @@
/* Xtensa configuration settings.
- Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ Copyright (C) 2001-2017 Free Software Foundation, Inc.
Contributed by Bob Wilson (bob.wilson@acm.org) at Tensilica.
This program is free software; you can redistribute it and/or modify