summaryrefslogtreecommitdiffstats
path: root/gcc/tree.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-10 17:34:47 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-10 17:34:47 +0000
commitd409f4c999310fd5a896e24614f7e114241d8171 (patch)
tree8829016c2ed4010c8ebc2fc7d926015013f72d69 /gcc/tree.c
parent78d8a26e7377d793bda744494b22b99adb734b28 (diff)
downloadppe42-gcc-d409f4c999310fd5a896e24614f7e114241d8171.tar.gz
ppe42-gcc-d409f4c999310fd5a896e24614f7e114241d8171.zip
.:
* tree.c (tree_check_failed): Emit general error if the list of node types is empty. cp: PR c++/18143 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK): New. (struct lang_decl_flags): Add thunk_p flag. (struct lang_decl): Remove separate fixed_offset. Place cloned_function and fixed_offset into union. (DECL_CLONED_FUNCTION_P, DECL_CLONED_FUNCTION): Adjust. (DECL_THUNK_P, SET_DECL_THUNK_P): Adjust. (THUNK_FIXED_OFFSET): Adjust. * method.c (make_thunk): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90399 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 3e40c2e7ad0..97adffabf3a 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5402,8 +5402,9 @@ get_set_constructor_bytes (tree init, unsigned char *buffer, int wd_size)
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
/* Complain that the tree code of NODE does not match the expected 0
- terminated list of trailing codes. FILE, LINE, and FUNCTION are of
- the caller. */
+ terminated list of trailing codes. The trailing code list can be
+ empty, for a more vague error message. FILE, LINE, and FUNCTION
+ are of the caller. */
void
tree_check_failed (const tree node, const char *file,
@@ -5418,22 +5419,27 @@ tree_check_failed (const tree node, const char *file,
while ((code = va_arg (args, int)))
length += 4 + strlen (tree_code_name[code]);
va_end (args);
- va_start (args, function);
- buffer = alloca (length);
- length = 0;
- while ((code = va_arg (args, int)))
+ if (length)
{
- if (length)
+ va_start (args, function);
+ length += strlen ("expected ");
+ buffer = alloca (length);
+ length = 0;
+ while ((code = va_arg (args, int)))
{
- strcpy (buffer + length, " or ");
- length += 4;
+ const char *prefix = length ? " or " : "expected ";
+
+ strcpy (buffer + length, prefix);
+ length += strlen (prefix);
+ strcpy (buffer + length, tree_code_name[code]);
+ length += strlen (tree_code_name[code]);
}
- strcpy (buffer + length, tree_code_name[code]);
- length += strlen (tree_code_name[code]);
+ va_end (args);
}
- va_end (args);
+ else
+ buffer = (char *)"unexpected node";
- internal_error ("tree check: expected %s, have %s in %s, at %s:%d",
+ internal_error ("tree check: %s, have %s in %s, at %s:%d",
buffer, tree_code_name[TREE_CODE (node)],
function, trim_filename (file), line);
}
OpenPOWER on IntegriCloud