Skip to content

Commit

Permalink
gccxml 2009-02-27 (b43d753b)
Browse files Browse the repository at this point in the history
  • Loading branch information
GCC-XML authored and kwrobot committed Feb 27, 2009
1 parent d9aece1 commit 92f9bed
Show file tree
Hide file tree
Showing 38 changed files with 3,175 additions and 349 deletions.
3 changes: 3 additions & 0 deletions GCC/config_cmake/libiberty_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@
/* Define to 1 if you have the `snprintf' function. */
#cmakedefine HAVE_SNPRINTF @HAVE_SNPRINTF@

/* Define to 1 if you have the <stddef.h> header file. */
#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@

/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@

Expand Down
5 changes: 4 additions & 1 deletion GCC/gcc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ ENDFOREACH(f)
IF(WIN32 AND NOT CYGWIN)
SET(AWK_EXECUTABLE "${GCC_SOURCE_DIR}/config_cmake/nawk.exe")
ELSE(WIN32 AND NOT CYGWIN)
FIND_PROGRAM(AWK_EXECUTABLE NAMES gawk awk)
# Prefer GNU awk at any location over the native awk if possible.
# The native awk on opensolaris causes opt-gather.awk to sort incorrectly.
FIND_PROGRAM(AWK_EXECUTABLE NAMES gawk)
FIND_PROGRAM(AWK_EXECUTABLE NAMES awk)
MARK_AS_ADVANCED(AWK_EXECUTABLE)
ENDIF(WIN32 AND NOT CYGWIN)

Expand Down
9 changes: 7 additions & 2 deletions GCC/gcc/cp/cp-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -4559,10 +4559,15 @@ extern tree cxx_staticp (tree);
extern int cp_gimplify_expr (tree *, tree *, tree *);
extern void cp_genericize (tree);

/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:38) */
/* BEGIN GCC-XML MODIFICATIONS 2003-11-21 */
/* in xml.c */
extern void do_xml_output PARAMS ((const char *));
/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:38) */
/* END GCC-XML MODIFICATIONS 2003-11-21 */

/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
/* In FUNCTION_DECL, true for artifical methods that should not exist. */
#define GCCXML_DECL_ERROR(NODE) DECL_COMMON_CHECK (NODE)->decl_common.gccxml_decl_error
/* END GCC-XML MODIFICATIONS 2008-02-27 */

/* -- end of C++ */

Expand Down
10 changes: 10 additions & 0 deletions GCC/gcc/cp/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,10 @@ do_build_assign_ref (tree fndecl)
finish_compound_stmt (compound_stmt);
}

/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
extern int diagnostic_xml_synthesize_test;
/* END GCC-XML MODIFICATIONS 2008-02-27 */

/* Synthesize FNDECL, a non-static member function. */

void
Expand All @@ -748,6 +752,9 @@ synthesize_method (tree fndecl)
location_t save_input_location = input_location;
int error_count = errorcount;
int warning_count = warningcount;
/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
int gccxml_synth_test = diagnostic_xml_synthesize_test;
/* END GCC-XML MODIFICATIONS 2008-02-27 */

/* Reset the source location, we might have been previously
deferred, and thus have saved where we were first needed. */
Expand Down Expand Up @@ -812,6 +819,9 @@ synthesize_method (tree fndecl)
if (error_count != errorcount || warning_count != warningcount)
inform ("%Hsynthesized method %qD first required here ",
&input_location, fndecl);
/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
GCCXML_DECL_ERROR(fndecl) = diagnostic_xml_synthesize_test != gccxml_synth_test;
/* END GCC-XML MODIFICATIONS 2008-02-27 */
}

/* Use EXTRACTOR to locate the relevant function called for each base &
Expand Down
13 changes: 13 additions & 0 deletions GCC/gcc/cp/pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -4382,6 +4382,12 @@ classtype_mangled_name (tree t)
return TYPE_IDENTIFIER (t);
}

/* BEGIN GCC-XML MODIFICATIONS 2008-01-05 */
/* xml.c uses this to suppress pending templates when testing whether
synthesizing an artificially-generated function succeeds. */
extern bool diagnostic_get_xml_synthesize_test();
/* END GCC-XML MODIFICATIONS 2008-01-05 */

static void
add_pending_template (tree d)
{
Expand All @@ -4391,6 +4397,13 @@ add_pending_template (tree d)
tree pt;
int level;

/* BEGIN GCC-XML MODIFICATIONS 2008-01-05 */
if(diagnostic_get_xml_synthesize_test())
{
return;
}
/* END GCC-XML MODIFICATIONS 2008-01-05 */

if (TI_PENDING_TEMPLATE_FLAG (ti))
return;

Expand Down
88 changes: 79 additions & 9 deletions GCC/gcc/cp/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ along with this program; if not, write to the

#include "toplev.h" /* ident_hash */

#define GCC_XML_C_VERSION "$Revision: 1.124 $"
#define GCC_XML_C_VERSION "$Revision: 1.128 $"

/*--------------------------------------------------------------------------*/
/* Data structures for the actual XML dump. */
Expand Down Expand Up @@ -1100,7 +1100,74 @@ xml_document_add_attribute_static_method(xml_document_element_p element)
}

/*--------------------------------------------------------------------------*/
/* Print XML attributes virtual="" and pure_virtual="" for a decl. */
static int
xml_print_overrides_r (xml_dump_info_p xdi, tree type, tree fndecl);

static int
xml_print_overrides (xml_dump_info_p xdi, tree type, tree fndecl)
{
tree binfo = TYPE_BINFO (type);
tree base_binfo;
int ix;
int found = 0;

for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
{
tree basetype = BINFO_TYPE (base_binfo);

if (TYPE_POLYMORPHIC_P (basetype))
{
found += xml_print_overrides_r (xdi, basetype, fndecl);
}
}
return found;
}

/* Look in TYPE for virtual functions overrides by FNDECL. Check both
TYPE itself and its bases. */
static int
xml_print_overrides_r (xml_dump_info_p xdi, tree type, tree fndecl)
{
tree fn = look_for_overrides_here (type, fndecl);

if (fn)
{
int id = xml_add_node (xdi, fn, 1);

if(id)
{
fprintf (xdi->file, "_%d ", id);
}

return 1;
}

/* We failed to find one declared in this class. Look in its bases. */
return xml_print_overrides (xdi, type, fndecl);
}

static void
xml_print_overrides_method_attribute (xml_dump_info_p xdi, tree d)
{
if (DECL_VIRTUAL_P (d))
{
fprintf (xdi->file, " overrides=\"");
xml_print_overrides(xdi, CP_DECL_CONTEXT(d), d);
fprintf (xdi->file, "\"");
}
}

static void
xml_document_add_attribute_overrides_method(xml_document_element_p element)
{
xml_document_add_attribute(element, "overrides",
xml_document_attribute_type_idrefs,
xml_document_attribute_use_optional, 0);
}

/*--------------------------------------------------------------------------*/
/* Print XML attributes virtual="", overrides="", and pure_virtual=""
for a decl. */
static void
xml_print_virtual_method_attributes (xml_dump_info_p xdi, tree d)
{
Expand All @@ -1113,6 +1180,8 @@ xml_print_virtual_method_attributes (xml_dump_info_p xdi, tree d)
{
fprintf (xdi->file, " pure_virtual=\"1\"");
}

xml_print_overrides_method_attribute(xdi, d);
}

static void
Expand All @@ -1124,6 +1193,7 @@ xml_document_add_attribute_virtual_method(xml_document_element_p element)
xml_document_add_attribute(element, "pure_virtual",
xml_document_attribute_type_boolean,
xml_document_attribute_use_optional, "0");
xml_document_add_attribute_overrides_method(element);
}

/*--------------------------------------------------------------------------*/
Expand Down Expand Up @@ -3273,16 +3343,16 @@ xml_add_node (xml_dump_info_p xdi, tree n, int complete)
synthesize_method (n);
pop_from_top_level ();

/* If an error occurred (and was suppressed) then this function is
invalid and should not be included. */
if(diagnostic_xml_synthesize_test > 1)
{
diagnostic_xml_synthesize_test = 0;
return 0;
}
/* Error messages have been converted to GCCXML_DECL_ERROR marks. */
diagnostic_xml_synthesize_test = 0;
}

/* Skip synthesized invalid compiler-generated functions. */
if (TREE_CODE (n) == FUNCTION_DECL && GCCXML_DECL_ERROR (n))
{
return 0;
}

/* Some nodes don't need to be dumped and just refer to other nodes.
These nodes should can have index zero because they should never
be referenced. */
Expand Down
4 changes: 4 additions & 0 deletions GCC/gcc/diagnostic.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ static bool diagnostic_in_xml_synthesize_test()
}
return false;
}
bool diagnostic_get_xml_synthesize_test()
{
return diagnostic_xml_synthesize_test > 0;
}
/* END GCC-XML MODIFICATIONS 2008-10-01 */

/* Count a diagnostic. Return true if the message should be printed. */
Expand Down
4 changes: 4 additions & 0 deletions GCC/gcc/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -2570,6 +2570,10 @@ struct tree_decl_common GTY(())
parm decl. */
unsigned gimple_reg_flag : 1;
unsigned call_clobbered_flag : 1;
/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
/* In FUNCTION_DECL, true for artifical methods that should not exist. */
unsigned gccxml_decl_error : 1;
/* END GCC-XML MODIFICATIONS 2008-02-27 */

union tree_decl_u1 {
/* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
Expand Down
8 changes: 6 additions & 2 deletions GCC/include/splay-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ extern "C" {
these types, if necessary. These types should be sufficiently wide
that any pointer or scalar can be cast to these types, and then
cast back, without loss of precision. */
typedef unsigned long int splay_tree_key;
typedef unsigned long int splay_tree_value;
/* BEGIN GCC-XML MODIFICATIONS 2009-02-05 */
/* For GCC-XML this is size_t instead of unsigned long int to support
64-bit compilers that have a 32-bit long. */
typedef size_t splay_tree_key;
typedef size_t splay_tree_value;
/* END GCC-XML MODIFICATIONS 2009-02-05 */

/* Forward declaration for a node in the tree. */
typedef struct splay_tree_node_s *splay_tree_node;
Expand Down
Loading

0 comments on commit 92f9bed

Please sign in to comment.