Skip to content

Commit 92f9bed

Browse files
GCC-XMLkwrobot
authored andcommitted
gccxml 2009-02-27 (b43d753b)
1 parent d9aece1 commit 92f9bed

38 files changed

+3175
-349
lines changed

GCC/config_cmake/libiberty_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@
194194
/* Define to 1 if you have the `snprintf' function. */
195195
#cmakedefine HAVE_SNPRINTF @HAVE_SNPRINTF@
196196

197+
/* Define to 1 if you have the <stddef.h> header file. */
198+
#cmakedefine HAVE_STDDEF_H @HAVE_STDDEF_H@
199+
197200
/* Define to 1 if you have the <stdint.h> header file. */
198201
#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
199202

GCC/gcc/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ ENDFOREACH(f)
145145
IF(WIN32 AND NOT CYGWIN)
146146
SET(AWK_EXECUTABLE "${GCC_SOURCE_DIR}/config_cmake/nawk.exe")
147147
ELSE(WIN32 AND NOT CYGWIN)
148-
FIND_PROGRAM(AWK_EXECUTABLE NAMES gawk awk)
148+
# Prefer GNU awk at any location over the native awk if possible.
149+
# The native awk on opensolaris causes opt-gather.awk to sort incorrectly.
150+
FIND_PROGRAM(AWK_EXECUTABLE NAMES gawk)
151+
FIND_PROGRAM(AWK_EXECUTABLE NAMES awk)
149152
MARK_AS_ADVANCED(AWK_EXECUTABLE)
150153
ENDIF(WIN32 AND NOT CYGWIN)
151154

GCC/gcc/cp/cp-tree.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4559,10 +4559,15 @@ extern tree cxx_staticp (tree);
45594559
extern int cp_gimplify_expr (tree *, tree *, tree *);
45604560
extern void cp_genericize (tree);
45614561

4562-
/* BEGIN GCC-XML MODIFICATIONS (2007/10/31 15:08:38) */
4562+
/* BEGIN GCC-XML MODIFICATIONS 2003-11-21 */
45634563
/* in xml.c */
45644564
extern void do_xml_output PARAMS ((const char *));
4565-
/* END GCC-XML MODIFICATIONS (2007/10/31 15:08:38) */
4565+
/* END GCC-XML MODIFICATIONS 2003-11-21 */
4566+
4567+
/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
4568+
/* In FUNCTION_DECL, true for artifical methods that should not exist. */
4569+
#define GCCXML_DECL_ERROR(NODE) DECL_COMMON_CHECK (NODE)->decl_common.gccxml_decl_error
4570+
/* END GCC-XML MODIFICATIONS 2008-02-27 */
45664571

45674572
/* -- end of C++ */
45684573

GCC/gcc/cp/method.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,10 @@ do_build_assign_ref (tree fndecl)
736736
finish_compound_stmt (compound_stmt);
737737
}
738738

739+
/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
740+
extern int diagnostic_xml_synthesize_test;
741+
/* END GCC-XML MODIFICATIONS 2008-02-27 */
742+
739743
/* Synthesize FNDECL, a non-static member function. */
740744

741745
void
@@ -748,6 +752,9 @@ synthesize_method (tree fndecl)
748752
location_t save_input_location = input_location;
749753
int error_count = errorcount;
750754
int warning_count = warningcount;
755+
/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
756+
int gccxml_synth_test = diagnostic_xml_synthesize_test;
757+
/* END GCC-XML MODIFICATIONS 2008-02-27 */
751758

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

817827
/* Use EXTRACTOR to locate the relevant function called for each base &

GCC/gcc/cp/pt.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4382,6 +4382,12 @@ classtype_mangled_name (tree t)
43824382
return TYPE_IDENTIFIER (t);
43834383
}
43844384

4385+
/* BEGIN GCC-XML MODIFICATIONS 2008-01-05 */
4386+
/* xml.c uses this to suppress pending templates when testing whether
4387+
synthesizing an artificially-generated function succeeds. */
4388+
extern bool diagnostic_get_xml_synthesize_test();
4389+
/* END GCC-XML MODIFICATIONS 2008-01-05 */
4390+
43854391
static void
43864392
add_pending_template (tree d)
43874393
{
@@ -4391,6 +4397,13 @@ add_pending_template (tree d)
43914397
tree pt;
43924398
int level;
43934399

4400+
/* BEGIN GCC-XML MODIFICATIONS 2008-01-05 */
4401+
if(diagnostic_get_xml_synthesize_test())
4402+
{
4403+
return;
4404+
}
4405+
/* END GCC-XML MODIFICATIONS 2008-01-05 */
4406+
43944407
if (TI_PENDING_TEMPLATE_FLAG (ti))
43954408
return;
43964409

GCC/gcc/cp/xml.c

Lines changed: 79 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ along with this program; if not, write to the
6565

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

68-
#define GCC_XML_C_VERSION "$Revision: 1.124 $"
68+
#define GCC_XML_C_VERSION "$Revision: 1.128 $"
6969

7070
/*--------------------------------------------------------------------------*/
7171
/* Data structures for the actual XML dump. */
@@ -1100,7 +1100,74 @@ xml_document_add_attribute_static_method(xml_document_element_p element)
11001100
}
11011101

11021102
/*--------------------------------------------------------------------------*/
1103-
/* Print XML attributes virtual="" and pure_virtual="" for a decl. */
1103+
static int
1104+
xml_print_overrides_r (xml_dump_info_p xdi, tree type, tree fndecl);
1105+
1106+
static int
1107+
xml_print_overrides (xml_dump_info_p xdi, tree type, tree fndecl)
1108+
{
1109+
tree binfo = TYPE_BINFO (type);
1110+
tree base_binfo;
1111+
int ix;
1112+
int found = 0;
1113+
1114+
for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
1115+
{
1116+
tree basetype = BINFO_TYPE (base_binfo);
1117+
1118+
if (TYPE_POLYMORPHIC_P (basetype))
1119+
{
1120+
found += xml_print_overrides_r (xdi, basetype, fndecl);
1121+
}
1122+
}
1123+
return found;
1124+
}
1125+
1126+
/* Look in TYPE for virtual functions overrides by FNDECL. Check both
1127+
TYPE itself and its bases. */
1128+
static int
1129+
xml_print_overrides_r (xml_dump_info_p xdi, tree type, tree fndecl)
1130+
{
1131+
tree fn = look_for_overrides_here (type, fndecl);
1132+
1133+
if (fn)
1134+
{
1135+
int id = xml_add_node (xdi, fn, 1);
1136+
1137+
if(id)
1138+
{
1139+
fprintf (xdi->file, "_%d ", id);
1140+
}
1141+
1142+
return 1;
1143+
}
1144+
1145+
/* We failed to find one declared in this class. Look in its bases. */
1146+
return xml_print_overrides (xdi, type, fndecl);
1147+
}
1148+
1149+
static void
1150+
xml_print_overrides_method_attribute (xml_dump_info_p xdi, tree d)
1151+
{
1152+
if (DECL_VIRTUAL_P (d))
1153+
{
1154+
fprintf (xdi->file, " overrides=\"");
1155+
xml_print_overrides(xdi, CP_DECL_CONTEXT(d), d);
1156+
fprintf (xdi->file, "\"");
1157+
}
1158+
}
1159+
1160+
static void
1161+
xml_document_add_attribute_overrides_method(xml_document_element_p element)
1162+
{
1163+
xml_document_add_attribute(element, "overrides",
1164+
xml_document_attribute_type_idrefs,
1165+
xml_document_attribute_use_optional, 0);
1166+
}
1167+
1168+
/*--------------------------------------------------------------------------*/
1169+
/* Print XML attributes virtual="", overrides="", and pure_virtual=""
1170+
for a decl. */
11041171
static void
11051172
xml_print_virtual_method_attributes (xml_dump_info_p xdi, tree d)
11061173
{
@@ -1113,6 +1180,8 @@ xml_print_virtual_method_attributes (xml_dump_info_p xdi, tree d)
11131180
{
11141181
fprintf (xdi->file, " pure_virtual=\"1\"");
11151182
}
1183+
1184+
xml_print_overrides_method_attribute(xdi, d);
11161185
}
11171186

11181187
static void
@@ -1124,6 +1193,7 @@ xml_document_add_attribute_virtual_method(xml_document_element_p element)
11241193
xml_document_add_attribute(element, "pure_virtual",
11251194
xml_document_attribute_type_boolean,
11261195
xml_document_attribute_use_optional, "0");
1196+
xml_document_add_attribute_overrides_method(element);
11271197
}
11281198

11291199
/*--------------------------------------------------------------------------*/
@@ -3273,16 +3343,16 @@ xml_add_node (xml_dump_info_p xdi, tree n, int complete)
32733343
synthesize_method (n);
32743344
pop_from_top_level ();
32753345

3276-
/* If an error occurred (and was suppressed) then this function is
3277-
invalid and should not be included. */
3278-
if(diagnostic_xml_synthesize_test > 1)
3279-
{
3280-
diagnostic_xml_synthesize_test = 0;
3281-
return 0;
3282-
}
3346+
/* Error messages have been converted to GCCXML_DECL_ERROR marks. */
32833347
diagnostic_xml_synthesize_test = 0;
32843348
}
32853349

3350+
/* Skip synthesized invalid compiler-generated functions. */
3351+
if (TREE_CODE (n) == FUNCTION_DECL && GCCXML_DECL_ERROR (n))
3352+
{
3353+
return 0;
3354+
}
3355+
32863356
/* Some nodes don't need to be dumped and just refer to other nodes.
32873357
These nodes should can have index zero because they should never
32883358
be referenced. */

GCC/gcc/diagnostic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ static bool diagnostic_in_xml_synthesize_test()
178178
}
179179
return false;
180180
}
181+
bool diagnostic_get_xml_synthesize_test()
182+
{
183+
return diagnostic_xml_synthesize_test > 0;
184+
}
181185
/* END GCC-XML MODIFICATIONS 2008-10-01 */
182186

183187
/* Count a diagnostic. Return true if the message should be printed. */

GCC/gcc/tree.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,6 +2570,10 @@ struct tree_decl_common GTY(())
25702570
parm decl. */
25712571
unsigned gimple_reg_flag : 1;
25722572
unsigned call_clobbered_flag : 1;
2573+
/* BEGIN GCC-XML MODIFICATIONS 2008-02-27 */
2574+
/* In FUNCTION_DECL, true for artifical methods that should not exist. */
2575+
unsigned gccxml_decl_error : 1;
2576+
/* END GCC-XML MODIFICATIONS 2008-02-27 */
25732577

25742578
union tree_decl_u1 {
25752579
/* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is

GCC/include/splay-tree.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ extern "C" {
4444
these types, if necessary. These types should be sufficiently wide
4545
that any pointer or scalar can be cast to these types, and then
4646
cast back, without loss of precision. */
47-
typedef unsigned long int splay_tree_key;
48-
typedef unsigned long int splay_tree_value;
47+
/* BEGIN GCC-XML MODIFICATIONS 2009-02-05 */
48+
/* For GCC-XML this is size_t instead of unsigned long int to support
49+
64-bit compilers that have a 32-bit long. */
50+
typedef size_t splay_tree_key;
51+
typedef size_t splay_tree_value;
52+
/* END GCC-XML MODIFICATIONS 2009-02-05 */
4953

5054
/* Forward declaration for a node in the tree. */
5155
typedef struct splay_tree_node_s *splay_tree_node;

0 commit comments

Comments
 (0)