mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 18:14:13 +08:00
Sync libiberty/ & include/ with GCC
Note this brings in the interface files for libcc1/G++ as well, which we will be needing in GDB soon anyway. That commit renamed a method in the C interface and that required a small update to GDB's compile/ code, which I've included that in this patch to keep the tree building. include/ChangeLog: 2017-09-15 Pedro Alves <palves@redhat.com> * ansidecl.h (DISABLE_COPY_AND_ASSIGN): New macro. 2017-09-12 Jiong Wang <jiong.wang@arm.com> * dwarf2.def (DW_CFA_AARCH64_negate_ra_state): New DW_CFA_DUP. * dwarf2.h (DW_CFA_DUP): New define. 2017-08-21 Richard Biener <rguenther@suse.de> * simple-object.h (simple_object_copy_lto_debug_sections): New function. 2017-05-18 Martin Liska <mliska@suse.cz> * ansidecl.h: Define CONSTEXPR macro. 2017-05-24 Nathan Sidwell <nathan@acm.org> * libiberty.h (ASTRDUP): Adjust cast to avoid warning. 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. 2016-04-29 Oleg Endo <olegendo@gcc.gnu.org> * longlong.h (umul_ppmm): Remove SHMEDIA checks. (__umulsidi3, count_leading_zeros): Remove SHMEDIA implementations. 2017-09-15 Yao Qi <yao.qi@linaro.org> Pedro Alves <palves@redhat.com> * ansidecl.h (DISABLE_COPY_AND_ASSIGN): New macro. 2017-09-12 Jiong Wang <jiong.wang@arm.com> * dwarf2.def (DW_CFA_AARCH64_negate_ra_state): New DW_CFA_DUP. * dwarf2.h (DW_CFA_DUP): New define. 2017-08-21 Richard Biener <rguenther@suse.de> * simple-object.h (simple_object_copy_lto_debug_sections): New function. 2017-05-18 Martin Liska <mliska@suse.cz> * ansidecl.h: Define CONSTEXPR macro. 2017-05-24 Nathan Sidwell <nathan@acm.org> * libiberty.h (ASTRDUP): Adjust cast to avoid warning. 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. 2016-04-29 Oleg Endo <olegendo@gcc.gnu.org> * longlong.h (umul_ppmm): Remove SHMEDIA checks. (__umulsidi3, count_leading_zeros): Remove SHMEDIA implementations. libiberty/ChangeLog: 2017-09-15 Nathan Sidwell <nathan@acm.org> PR demangler/82195 * cp-demangle.c (d_name): Add 'toplevel' parm. Pass to ... (d_local_name): ... here. Parse trailing function args on nested local_name. (d_encoding, d_special_name, d_class_enum_type): Adjust d_name calls. * testsuite/demangle-expected: Add tests. 2017-09-15 Richard Biener <rguenther@suse.de> PR lto/81968 * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): Iterate marking dependent sections necessary. 2017-09-15 Nathan Sidwell <nathan@acm.org> * cp-demangle.c (is_fnqual_component_type): Reimplement using FNQUAL_COMPONENT_CASE. (d_encoding): Hold bare_function_type in local var. (d_local_name): Build name in both cases and build result once. Collapse switch-if to single conditional. (d_local_name): * testsuite/demangle-expected: Realign blank lines with tests. 2017-09-12 Jiong Wang <jiong.wang@arm.com> * dwarfnames.c (DW_CFA_DUP): New define. gdb/ChangeLog: 2017-09-15 Pedro Alves <palves@redhat.com> * compile/compile-c-types.c (convert_enum, convert_int) (convert_float): Adjust to refer to int_type_v0 and float_type_v0.
This commit is contained in:
parent
124aceb46d
commit
26a67918a5
@ -1,3 +1,8 @@
|
||||
2017-09-15 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* compile/compile-c-types.c (convert_enum, convert_int)
|
||||
(convert_float): Adjust to refer to int_type_v0 and float_type_v0.
|
||||
|
||||
2017-09-15 Simon Marchi <simon.marchi@ericsson.com>
|
||||
|
||||
* dwarf2read.c (copy_string): Remove.
|
||||
|
@ -207,9 +207,9 @@ convert_enum (struct compile_c_instance *context, struct type *type)
|
||||
int i;
|
||||
struct gcc_c_context *ctx = C_CTX (context);
|
||||
|
||||
int_type = ctx->c_ops->int_type (ctx,
|
||||
TYPE_UNSIGNED (type),
|
||||
TYPE_LENGTH (type));
|
||||
int_type = ctx->c_ops->int_type_v0 (ctx,
|
||||
TYPE_UNSIGNED (type),
|
||||
TYPE_LENGTH (type));
|
||||
|
||||
result = ctx->c_ops->build_enum_type (ctx, int_type);
|
||||
for (i = 0; i < TYPE_NFIELDS (type); ++i)
|
||||
@ -273,9 +273,9 @@ convert_func (struct compile_c_instance *context, struct type *type)
|
||||
static gcc_type
|
||||
convert_int (struct compile_c_instance *context, struct type *type)
|
||||
{
|
||||
return C_CTX (context)->c_ops->int_type (C_CTX (context),
|
||||
TYPE_UNSIGNED (type),
|
||||
TYPE_LENGTH (type));
|
||||
return C_CTX (context)->c_ops->int_type_v0 (C_CTX (context),
|
||||
TYPE_UNSIGNED (type),
|
||||
TYPE_LENGTH (type));
|
||||
}
|
||||
|
||||
/* Convert a floating-point type to its gcc representation. */
|
||||
@ -283,8 +283,8 @@ convert_int (struct compile_c_instance *context, struct type *type)
|
||||
static gcc_type
|
||||
convert_float (struct compile_c_instance *context, struct type *type)
|
||||
{
|
||||
return C_CTX (context)->c_ops->float_type (C_CTX (context),
|
||||
TYPE_LENGTH (type));
|
||||
return C_CTX (context)->c_ops->float_type_v0 (C_CTX (context),
|
||||
TYPE_LENGTH (type));
|
||||
}
|
||||
|
||||
/* Convert the 'void' type to its gcc representation. */
|
||||
|
@ -1,3 +1,91 @@
|
||||
2017-09-15 Pedro Alves <palves@redhat.com>
|
||||
|
||||
Sync with mainline gcc sources (r252823)
|
||||
|
||||
2017-09-15 Yao Qi <yao.qi@linaro.org>
|
||||
Pedro Alves <palves@redhat.com>
|
||||
|
||||
* ansidecl.h (DISABLE_COPY_AND_ASSIGN): New macro.
|
||||
|
||||
2017-09-12 Jiong Wang <jiong.wang@arm.com>
|
||||
|
||||
* dwarf2.def (DW_CFA_AARCH64_negate_ra_state): New DW_CFA_DUP.
|
||||
* dwarf2.h (DW_CFA_DUP): New define.
|
||||
|
||||
2017-08-21 Richard Biener <rguenther@suse.de>
|
||||
|
||||
* simple-object.h (simple_object_copy_lto_debug_sections): New
|
||||
function.
|
||||
|
||||
2017-05-18 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* ansidecl.h: Define CONSTEXPR macro.
|
||||
|
||||
2017-05-24 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
* libiberty.h (ASTRDUP): Adjust cast to avoid warning.
|
||||
|
||||
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.
|
||||
|
||||
2016-04-29 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
* longlong.h (umul_ppmm): Remove SHMEDIA checks.
|
||||
(__umulsidi3, count_leading_zeros): Remove SHMEDIA implementations.
|
||||
|
||||
2017-09-15 Yao Qi <yao.qi@linaro.org>
|
||||
Pedro Alves <palves@redhat.com>
|
||||
|
||||
* ansidecl.h (DISABLE_COPY_AND_ASSIGN): New macro.
|
||||
|
||||
2017-09-12 Jiong Wang <jiong.wang@arm.com>
|
||||
|
||||
* dwarf2.def (DW_CFA_AARCH64_negate_ra_state): New DW_CFA_DUP.
|
||||
* dwarf2.h (DW_CFA_DUP): New define.
|
||||
|
||||
2017-08-21 Richard Biener <rguenther@suse.de>
|
||||
|
||||
* simple-object.h (simple_object_copy_lto_debug_sections): New
|
||||
function.
|
||||
|
||||
2017-05-18 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* ansidecl.h: Define CONSTEXPR macro.
|
||||
|
||||
2017-05-24 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
* libiberty.h (ASTRDUP): Adjust cast to avoid warning.
|
||||
|
||||
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.
|
||||
|
||||
2016-04-29 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
* longlong.h (umul_ppmm): Remove SHMEDIA checks.
|
||||
(__umulsidi3, count_leading_zeros): Remove SHMEDIA implementations.
|
||||
|
||||
2017-09-06 Kamil Rytarowski <n54@gmx.com>
|
||||
|
||||
* opcode/nds32.h: Rename __BIT() to N32_BIT().
|
||||
|
@ -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,6 +313,12 @@ So instead we use the macro below and test it against specific values. */
|
||||
#define ENUM_BITFIELD(TYPE) unsigned int
|
||||
#endif
|
||||
|
||||
#if __cpp_constexpr >= 200704
|
||||
#define CONSTEXPR constexpr
|
||||
#else
|
||||
#define CONSTEXPR
|
||||
#endif
|
||||
|
||||
/* 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
|
||||
@ -354,6 +360,32 @@ So instead we use the macro below and test it against specific values. */
|
||||
# define FINAL
|
||||
#endif
|
||||
|
||||
/* A macro to disable the copy constructor and assignment operator.
|
||||
When building with C++11 and above, the methods are explicitly
|
||||
deleted, causing a compile-time error if something tries to copy.
|
||||
For C++03, this just declares the methods, causing a link-time
|
||||
error if the methods end up called (assuming you don't
|
||||
define them). For C++03, for best results, place the macro
|
||||
under the private: access specifier, like this,
|
||||
|
||||
class name_lookup
|
||||
{
|
||||
private:
|
||||
DISABLE_COPY_AND_ASSIGN (name_lookup);
|
||||
};
|
||||
|
||||
so that most attempts at copy are caught at compile-time. */
|
||||
|
||||
#if __cplusplus >= 201103
|
||||
#define DISABLE_COPY_AND_ASSIGN(TYPE) \
|
||||
TYPE (const TYPE&) = delete; \
|
||||
void operator= (const TYPE &) = delete
|
||||
#else
|
||||
#define DISABLE_COPY_AND_ASSIGN(TYPE) \
|
||||
TYPE (const TYPE&); \
|
||||
void operator= (const TYPE &)
|
||||
#endif /* __cplusplus >= 201103 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -778,6 +778,7 @@ DW_CFA (DW_CFA_MIPS_advance_loc8, 0x1d)
|
||||
/* GNU extensions.
|
||||
NOTE: DW_CFA_GNU_window_save is multiplexed on Sparc and AArch64. */
|
||||
DW_CFA (DW_CFA_GNU_window_save, 0x2d)
|
||||
DW_CFA_DUP (DW_CFA_AARCH64_negate_ra_state, 0x2d)
|
||||
DW_CFA (DW_CFA_GNU_args_size, 0x2e)
|
||||
DW_CFA (DW_CFA_GNU_negative_offset_extended, 0x2f)
|
||||
|
||||
|
@ -52,6 +52,7 @@
|
||||
#define DW_ATE(name, value) , name = value
|
||||
#define DW_ATE_DUP(name, value) , name = value
|
||||
#define DW_CFA(name, value) , name = value
|
||||
#define DW_CFA_DUP(name, value) , name = value
|
||||
#define DW_IDX(name, value) , name = value
|
||||
#define DW_IDX_DUP(name, value) , name = value
|
||||
|
||||
@ -104,6 +105,7 @@
|
||||
#undef DW_ATE
|
||||
#undef DW_ATE_DUP
|
||||
#undef DW_CFA
|
||||
#undef DW_CFA_DUP
|
||||
#undef DW_IDX
|
||||
#undef DW_IDX_DUP
|
||||
|
||||
|
@ -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. */
|
||||
|
||||
|
@ -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,
|
||||
|
1050
include/gcc-cp-fe.def
Normal file
1050
include/gcc-cp-fe.def
Normal file
File diff suppressed because it is too large
Load Diff
496
include/gcc-cp-interface.h
Normal file
496
include/gcc-cp-interface.h
Normal file
@ -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 */
|
@ -169,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"
|
||||
|
@ -3,7 +3,7 @@
|
||||
Copyright (C) 1997-2017 Free Software Foundation, Inc.
|
||||
|
||||
Note - certain prototypes declared in this header file are for
|
||||
functions whose implementation copyright does not belong to the
|
||||
functions whoes implementation copyright does not belong to the
|
||||
FSF. Those prototypes are present in this file for reference
|
||||
purposes only and their presence in this file should not construed
|
||||
as an indication of ownership by the FSF of the implementation of
|
||||
@ -724,7 +724,7 @@ extern void *C_alloca (size_t) ATTRIBUTE_MALLOC;
|
||||
# define ASTRDUP(X) \
|
||||
(__extension__ ({ const char *const libiberty_optr = (X); \
|
||||
const unsigned long libiberty_len = strlen (libiberty_optr) + 1; \
|
||||
char *const libiberty_nptr = (char *const) alloca (libiberty_len); \
|
||||
char *const libiberty_nptr = (char *) alloca (libiberty_len); \
|
||||
(char *) memcpy (libiberty_nptr, libiberty_optr, libiberty_len); }))
|
||||
#else
|
||||
# define alloca(x) C_alloca(x)
|
||||
|
@ -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
|
||||
@ -858,42 +858,6 @@ extern UDItype __umulsidi3 (USItype, USItype);
|
||||
#endif
|
||||
#endif /* __mips__ */
|
||||
|
||||
#if defined (__ns32000__) && W_TYPE_SIZE == 32
|
||||
#define umul_ppmm(w1, w0, u, v) \
|
||||
({union {UDItype __ll; \
|
||||
struct {USItype __l, __h;} __i; \
|
||||
} __xx; \
|
||||
__asm__ ("meid %2,%0" \
|
||||
: "=g" (__xx.__ll) \
|
||||
: "%0" ((USItype) (u)), \
|
||||
"g" ((USItype) (v))); \
|
||||
(w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
|
||||
#define __umulsidi3(u, v) \
|
||||
({UDItype __w; \
|
||||
__asm__ ("meid %2,%0" \
|
||||
: "=g" (__w) \
|
||||
: "%0" ((USItype) (u)), \
|
||||
"g" ((USItype) (v))); \
|
||||
__w; })
|
||||
#define udiv_qrnnd(q, r, n1, n0, d) \
|
||||
({union {UDItype __ll; \
|
||||
struct {USItype __l, __h;} __i; \
|
||||
} __xx; \
|
||||
__xx.__i.__h = (n1); __xx.__i.__l = (n0); \
|
||||
__asm__ ("deid %2,%0" \
|
||||
: "=g" (__xx.__ll) \
|
||||
: "0" (__xx.__ll), \
|
||||
"g" ((USItype) (d))); \
|
||||
(r) = __xx.__i.__l; (q) = __xx.__i.__h; })
|
||||
#define count_trailing_zeros(count,x) \
|
||||
do { \
|
||||
__asm__ ("ffsd %2,%0" \
|
||||
: "=r" ((USItype) (count)) \
|
||||
: "0" ((USItype) 0), \
|
||||
"r" ((USItype) (x))); \
|
||||
} while (0)
|
||||
#endif /* __ns32000__ */
|
||||
|
||||
/* FIXME: We should test _IBMR2 here when we add assembly support for the
|
||||
system vendor compilers.
|
||||
FIXME: What's needed for gcc PowerPC VxWorks? __vxworks__ is not good
|
||||
@ -1086,7 +1050,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 +1123,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) \
|
||||
|
@ -197,6 +197,14 @@ simple_object_write_to_file (simple_object_write *simple_object,
|
||||
extern void
|
||||
simple_object_release_write (simple_object_write *);
|
||||
|
||||
/* Copy LTO debug sections from SRC_OBJECT to DEST.
|
||||
If an error occurs, return the errno value in ERR and an error string. */
|
||||
|
||||
extern const char *
|
||||
simple_object_copy_lto_debug_sections (simple_object_read *src_object,
|
||||
const char *dest,
|
||||
int *err);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,33 @@
|
||||
2017-09-15 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR demangler/82195
|
||||
* cp-demangle.c (d_name): Add 'toplevel' parm. Pass to ...
|
||||
(d_local_name): ... here. Parse trailing function args on nested
|
||||
local_name.
|
||||
(d_encoding, d_special_name, d_class_enum_type): Adjust d_name calls.
|
||||
* testsuite/demangle-expected: Add tests.
|
||||
|
||||
2017-09-15 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR lto/81968
|
||||
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
|
||||
Iterate marking dependent sections necessary.
|
||||
|
||||
2017-09-15 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
* cp-demangle.c (is_fnqual_component_type): Reimplement using
|
||||
FNQUAL_COMPONENT_CASE.
|
||||
(d_encoding): Hold bare_function_type in local var.
|
||||
(d_local_name): Build name in both cases and build result once.
|
||||
Collapse switch-if to single conditional.
|
||||
(d_local_name):
|
||||
|
||||
* testsuite/demangle-expected: Realign blank lines with tests.
|
||||
|
||||
2017-09-12 Jiong Wang <jiong.wang@arm.com>
|
||||
|
||||
* dwarfnames.c (DW_CFA_DUP): New define.
|
||||
|
||||
2017-09-01 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
|
||||
|
@ -425,7 +425,7 @@ is_ctor_dtor_or_conversion (struct demangle_component *);
|
||||
|
||||
static struct demangle_component *d_encoding (struct d_info *, int);
|
||||
|
||||
static struct demangle_component *d_name (struct d_info *);
|
||||
static struct demangle_component *d_name (struct d_info *, int);
|
||||
|
||||
static struct demangle_component *d_nested_name (struct d_info *);
|
||||
|
||||
@ -484,7 +484,7 @@ static struct demangle_component *d_expression (struct d_info *);
|
||||
|
||||
static struct demangle_component *d_expr_primary (struct d_info *);
|
||||
|
||||
static struct demangle_component *d_local_name (struct d_info *);
|
||||
static struct demangle_component *d_local_name (struct d_info *, int);
|
||||
|
||||
static int d_discriminator (struct d_info *);
|
||||
|
||||
@ -568,22 +568,6 @@ static int d_demangle_callback (const char *, int,
|
||||
demangle_callbackref, void *);
|
||||
static char *d_demangle (const char *, int, size_t *);
|
||||
|
||||
/* True iff TYPE is a demangling component representing a
|
||||
function-type-qualifier. */
|
||||
|
||||
static int
|
||||
is_fnqual_component_type (enum demangle_component_type type)
|
||||
{
|
||||
return (type == DEMANGLE_COMPONENT_RESTRICT_THIS
|
||||
|| type == DEMANGLE_COMPONENT_VOLATILE_THIS
|
||||
|| type == DEMANGLE_COMPONENT_CONST_THIS
|
||||
|| type == DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS
|
||||
|| type == DEMANGLE_COMPONENT_TRANSACTION_SAFE
|
||||
|| type == DEMANGLE_COMPONENT_NOEXCEPT
|
||||
|| type == DEMANGLE_COMPONENT_THROW_SPEC
|
||||
|| type == DEMANGLE_COMPONENT_REFERENCE_THIS);
|
||||
}
|
||||
|
||||
#define FNQUAL_COMPONENT_CASE \
|
||||
case DEMANGLE_COMPONENT_RESTRICT_THIS: \
|
||||
case DEMANGLE_COMPONENT_VOLATILE_THIS: \
|
||||
@ -594,6 +578,23 @@ is_fnqual_component_type (enum demangle_component_type type)
|
||||
case DEMANGLE_COMPONENT_NOEXCEPT: \
|
||||
case DEMANGLE_COMPONENT_THROW_SPEC
|
||||
|
||||
/* True iff TYPE is a demangling component representing a
|
||||
function-type-qualifier. */
|
||||
|
||||
static int
|
||||
is_fnqual_component_type (enum demangle_component_type type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
FNQUAL_COMPONENT_CASE:
|
||||
return 1;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CP_DEMANGLE_DEBUG
|
||||
|
||||
static void
|
||||
@ -1305,9 +1306,9 @@ d_encoding (struct d_info *di, int top_level)
|
||||
return d_special_name (di);
|
||||
else
|
||||
{
|
||||
struct demangle_component *dc;
|
||||
struct demangle_component *dc, *dcr;
|
||||
|
||||
dc = d_name (di);
|
||||
dc = d_name (di, top_level);
|
||||
|
||||
if (dc != NULL && top_level && (di->options & DMGL_PARAMS) == 0)
|
||||
{
|
||||
@ -1327,8 +1328,6 @@ d_encoding (struct d_info *di, int top_level)
|
||||
which is local to a function. */
|
||||
if (dc->type == DEMANGLE_COMPONENT_LOCAL_NAME)
|
||||
{
|
||||
struct demangle_component *dcr;
|
||||
|
||||
dcr = d_right (dc);
|
||||
while (is_fnqual_component_type (dcr->type))
|
||||
dcr = d_left (dcr);
|
||||
@ -1341,8 +1340,8 @@ d_encoding (struct d_info *di, int top_level)
|
||||
peek = d_peek_char (di);
|
||||
if (dc == NULL || peek == '\0' || peek == 'E')
|
||||
return dc;
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME, dc,
|
||||
d_bare_function_type (di, has_return_type (dc)));
|
||||
dcr = d_bare_function_type (di, has_return_type (dc));
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME, dc, dcr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1384,7 +1383,7 @@ d_abi_tags (struct d_info *di, struct demangle_component *dc)
|
||||
*/
|
||||
|
||||
static struct demangle_component *
|
||||
d_name (struct d_info *di)
|
||||
d_name (struct d_info *di, int top_level)
|
||||
{
|
||||
char peek = d_peek_char (di);
|
||||
struct demangle_component *dc;
|
||||
@ -1395,7 +1394,7 @@ d_name (struct d_info *di)
|
||||
return d_nested_name (di);
|
||||
|
||||
case 'Z':
|
||||
return d_local_name (di);
|
||||
return d_local_name (di, top_level);
|
||||
|
||||
case 'U':
|
||||
return d_unqualified_name (di);
|
||||
@ -2080,11 +2079,11 @@ d_special_name (struct d_info *di)
|
||||
|
||||
case 'H':
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_TLS_INIT,
|
||||
d_name (di), NULL);
|
||||
d_name (di, 0), NULL);
|
||||
|
||||
case 'W':
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_TLS_WRAPPER,
|
||||
d_name (di), NULL);
|
||||
d_name (di, 0), NULL);
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
@ -2095,11 +2094,12 @@ d_special_name (struct d_info *di)
|
||||
switch (d_next_char (di))
|
||||
{
|
||||
case 'V':
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_GUARD, d_name (di), NULL);
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_GUARD,
|
||||
d_name (di, 0), NULL);
|
||||
|
||||
case 'R':
|
||||
{
|
||||
struct demangle_component *name = d_name (di);
|
||||
struct demangle_component *name = d_name (di, 0);
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_REFTEMP, name,
|
||||
d_number_component (di));
|
||||
}
|
||||
@ -2935,7 +2935,7 @@ d_bare_function_type (struct d_info *di, int has_return_type)
|
||||
static struct demangle_component *
|
||||
d_class_enum_type (struct d_info *di)
|
||||
{
|
||||
return d_name (di);
|
||||
return d_name (di, 0);
|
||||
}
|
||||
|
||||
/* <array-type> ::= A <(positive dimension) number> _ <(element) type>
|
||||
@ -3568,9 +3568,10 @@ d_expr_primary (struct d_info *di)
|
||||
*/
|
||||
|
||||
static struct demangle_component *
|
||||
d_local_name (struct d_info *di)
|
||||
d_local_name (struct d_info *di, int top_level)
|
||||
{
|
||||
struct demangle_component *function;
|
||||
struct demangle_component *name;
|
||||
|
||||
if (! d_check_char (di, 'Z'))
|
||||
return NULL;
|
||||
@ -3585,13 +3586,10 @@ d_local_name (struct d_info *di)
|
||||
d_advance (di, 1);
|
||||
if (! d_discriminator (di))
|
||||
return NULL;
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_LOCAL_NAME, function,
|
||||
d_make_name (di, "string literal",
|
||||
sizeof "string literal" - 1));
|
||||
name = d_make_name (di, "string literal", sizeof "string literal" - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
struct demangle_component *name;
|
||||
int num = -1;
|
||||
|
||||
if (d_peek_char (di) == 'd')
|
||||
@ -3603,22 +3601,36 @@ d_local_name (struct d_info *di)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
name = d_name (di);
|
||||
if (name)
|
||||
switch (name->type)
|
||||
{
|
||||
/* Lambdas and unnamed types have internal discriminators. */
|
||||
case DEMANGLE_COMPONENT_LAMBDA:
|
||||
case DEMANGLE_COMPONENT_UNNAMED_TYPE:
|
||||
break;
|
||||
default:
|
||||
if (! d_discriminator (di))
|
||||
return NULL;
|
||||
}
|
||||
name = d_name (di, 0);
|
||||
|
||||
if (name
|
||||
/* Lambdas and unnamed types have internal discriminators
|
||||
and are not functions. */
|
||||
&& name->type != DEMANGLE_COMPONENT_LAMBDA
|
||||
&& name->type != DEMANGLE_COMPONENT_UNNAMED_TYPE)
|
||||
{
|
||||
if (!top_level
|
||||
&& d_peek_char (di) != 0 /* Not end of string. */
|
||||
&& d_peek_char (di) != 'E' /* Not end of nested encoding. */
|
||||
&& d_peek_char (di) != '_') /* Not discriminator. */
|
||||
{
|
||||
struct demangle_component *args;
|
||||
|
||||
args = d_bare_function_type (di, has_return_type (name));
|
||||
name = d_make_comp (di, DEMANGLE_COMPONENT_TYPED_NAME,
|
||||
name, args);
|
||||
}
|
||||
|
||||
/* Read and ignore an optional discriminator. */
|
||||
if (! d_discriminator (di))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (num >= 0)
|
||||
name = d_make_default_arg (di, num, name);
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_LOCAL_NAME, function, name);
|
||||
}
|
||||
|
||||
return d_make_comp (di, DEMANGLE_COMPONENT_LOCAL_NAME, function, name);
|
||||
}
|
||||
|
||||
/* <discriminator> ::= _ <number> # when number < 10
|
||||
|
@ -75,6 +75,7 @@ Boston, MA 02110-1301, USA. */
|
||||
#define DW_ATE(name, value) case name: return # name ;
|
||||
#define DW_ATE_DUP(name, value)
|
||||
#define DW_CFA(name, value) case name: return # name ;
|
||||
#define DW_CFA_DUP(name, value)
|
||||
#define DW_IDX(name, value) case name: return # name ;
|
||||
#define DW_IDX_DUP(name, value)
|
||||
|
||||
@ -105,5 +106,6 @@ Boston, MA 02110-1301, USA. */
|
||||
#undef DW_ATE
|
||||
#undef DW_ATE_DUP
|
||||
#undef DW_CFA
|
||||
#undef DW_CFA_DUP
|
||||
#undef DW_IDX
|
||||
#undef DW_IDX_DUP
|
||||
|
@ -1158,70 +1158,84 @@ simple_object_elf_copy_lto_debug_sections (simple_object_read *sobj,
|
||||
|
||||
/* Mark sections as preserved that are required by to be preserved
|
||||
sections. */
|
||||
for (i = 1; i < shnum; ++i)
|
||||
int changed;
|
||||
do
|
||||
{
|
||||
unsigned char *shdr;
|
||||
unsigned int sh_type, sh_info, sh_link;
|
||||
off_t offset;
|
||||
off_t length;
|
||||
changed = 0;
|
||||
for (i = 1; i < shnum; ++i)
|
||||
{
|
||||
unsigned char *shdr;
|
||||
unsigned int sh_type, sh_info, sh_link;
|
||||
off_t offset;
|
||||
off_t length;
|
||||
|
||||
shdr = shdrs + (i - 1) * shdr_size;
|
||||
sh_type = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_type, Elf_Word);
|
||||
sh_info = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_info, Elf_Word);
|
||||
sh_link = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_link, Elf_Word);
|
||||
if (sh_type == SHT_GROUP)
|
||||
{
|
||||
/* Mark groups containing copied sections. */
|
||||
unsigned entsize = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_entsize, Elf_Addr);
|
||||
unsigned char *ent, *buf;
|
||||
int keep = 0;
|
||||
offset = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_offset, Elf_Addr);
|
||||
length = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_size, Elf_Addr);
|
||||
buf = XNEWVEC (unsigned char, length);
|
||||
if (!simple_object_internal_read (sobj->descriptor,
|
||||
sobj->offset + offset, buf,
|
||||
(size_t) length, &errmsg, err))
|
||||
shdr = shdrs + (i - 1) * shdr_size;
|
||||
sh_type = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_type, Elf_Word);
|
||||
sh_info = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_info, Elf_Word);
|
||||
sh_link = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_link, Elf_Word);
|
||||
if (sh_type == SHT_GROUP)
|
||||
{
|
||||
XDELETEVEC (buf);
|
||||
XDELETEVEC (names);
|
||||
XDELETEVEC (shdrs);
|
||||
return errmsg;
|
||||
/* Mark groups containing copied sections. */
|
||||
unsigned entsize = ELF_FETCH_FIELD (type_functions, ei_class,
|
||||
Shdr, shdr, sh_entsize,
|
||||
Elf_Addr);
|
||||
unsigned char *ent, *buf;
|
||||
int keep = 0;
|
||||
offset = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_offset, Elf_Addr);
|
||||
length = ELF_FETCH_FIELD (type_functions, ei_class, Shdr,
|
||||
shdr, sh_size, Elf_Addr);
|
||||
buf = XNEWVEC (unsigned char, length);
|
||||
if (!simple_object_internal_read (sobj->descriptor,
|
||||
sobj->offset + offset, buf,
|
||||
(size_t) length, &errmsg, err))
|
||||
{
|
||||
XDELETEVEC (buf);
|
||||
XDELETEVEC (names);
|
||||
XDELETEVEC (shdrs);
|
||||
return errmsg;
|
||||
}
|
||||
for (ent = buf + entsize; ent < buf + length; ent += entsize)
|
||||
{
|
||||
unsigned sec = type_functions->fetch_Elf_Word (ent);
|
||||
if (pfnret[sec - 1] == 0)
|
||||
keep = 1;
|
||||
}
|
||||
if (keep)
|
||||
{
|
||||
changed |= (pfnret[sh_link - 1] == -1
|
||||
|| pfnret[i - 1] == -1);
|
||||
pfnret[sh_link - 1] = 0;
|
||||
pfnret[i - 1] = 0;
|
||||
}
|
||||
}
|
||||
for (ent = buf + entsize; ent < buf + length; ent += entsize)
|
||||
if (sh_type == SHT_RELA
|
||||
|| sh_type == SHT_REL)
|
||||
{
|
||||
unsigned sec = type_functions->fetch_Elf_Word (ent);
|
||||
if (pfnret[sec - 1] == 0)
|
||||
keep = 1;
|
||||
/* Mark relocation sections and symtab of copied sections. */
|
||||
if (pfnret[sh_info - 1] == 0)
|
||||
{
|
||||
changed |= (pfnret[sh_link - 1] == -1
|
||||
|| pfnret[i - 1] == -1);
|
||||
pfnret[sh_link - 1] = 0;
|
||||
pfnret[i - 1] = 0;
|
||||
}
|
||||
}
|
||||
if (keep)
|
||||
if (sh_type == SHT_SYMTAB)
|
||||
{
|
||||
pfnret[sh_link - 1] = 0;
|
||||
pfnret[i - 1] = 0;
|
||||
/* Mark strings sections of copied symtabs. */
|
||||
if (pfnret[i - 1] == 0)
|
||||
{
|
||||
changed |= pfnret[sh_link - 1] == -1;
|
||||
pfnret[sh_link - 1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sh_type == SHT_RELA
|
||||
|| sh_type == SHT_REL)
|
||||
{
|
||||
/* Mark relocation sections and symtab of copied sections. */
|
||||
if (pfnret[sh_info - 1] == 0)
|
||||
{
|
||||
pfnret[sh_link - 1] = 0;
|
||||
pfnret[i - 1] = 0;
|
||||
}
|
||||
}
|
||||
if (sh_type == SHT_SYMTAB)
|
||||
{
|
||||
/* Mark strings sections of copied symtabs. */
|
||||
if (pfnret[i - 1] == 0)
|
||||
pfnret[sh_link - 1] = 0;
|
||||
}
|
||||
}
|
||||
while (changed);
|
||||
|
||||
/* Then perform the actual copying. */
|
||||
for (i = 1; i < shnum; ++i)
|
||||
|
@ -4720,18 +4720,33 @@ _ZdvMMMMMMMMMMMMMrrrrA_DTdvfp_fp_Eededilfdfdfdfd
|
||||
|
||||
_Z1MA_aMMMMA_MMA_MMMMMMMMSt1MS_o11T0000000000t2M0oooozoooo
|
||||
_Z1MA_aMMMMA_MMA_MMMMMMMMSt1MS_o11T0000000000t2M0oooozoooo
|
||||
|
||||
#
|
||||
# demangler/80513 Test for overflow in d_number
|
||||
_Z4294967297x
|
||||
_Z4294967297x
|
||||
|
||||
_Z4294967297x
|
||||
_Z4294967297x
|
||||
#
|
||||
# demangler/80513 Test for bogus characters after __thunk_
|
||||
__thunk_16a_$_1x
|
||||
__thunk_16a_$_1x
|
||||
|
||||
__thunk_16a_$_1x
|
||||
__thunk_16a_$_1x
|
||||
#
|
||||
# demangler/80513 Test for overflow in consume_count
|
||||
|
||||
__thunk_4294967297__$_1x
|
||||
__thunk_4294967297__$_1x
|
||||
#
|
||||
# demangler/82195 members of lambdas
|
||||
--no-params
|
||||
_ZZZ3FoovENKUlT_E_clIiEEfS_EN5Local2fnEv
|
||||
Foo()::float {lambda(auto:1)#1}::operator()<int>(int) const::Local::fn()
|
||||
Foo()::float {lambda(auto:1)#1}::operator()<int>(int) const::Local::fn
|
||||
--no-params
|
||||
_Z7CaptureIZZ3FoovENKUlT_E_clIiEEvS0_EUlvE_EvOS0_
|
||||
void Capture<Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>(Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}&&)
|
||||
Capture<Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>
|
||||
--no-params
|
||||
_Z4FrobIZZ3FoovENKUlT_E_clIiEEvS0_EUlvE_Evv
|
||||
void Frob<Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>()
|
||||
Frob<Foo()::void {lambda(auto:1)#1}::operator()<int>(int) const::{lambda()#1}>
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user