Commit 761f0855 by Gabriel Dos Reis Committed by Gabriel Dos Reis

memtemp77.C (main): Adjust comparison against.

testsuite/
	* g++.old-deja/g++.pt/memtemp77.C (main): Adjust comparison against.
	__PRETTY_FUNCTION__

cp/
	* error.c: Move TFF_ macros into cp-tree.h.  Throughout, replace
	TS_* flags with corresponding TFF_*.  Adjust prototypes of
	functions (which used to take a tree_string_flags) to take an int.

	* cp-tree.h (enum tree_string_flags): Remove
	(TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE,
	TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPEDEF, TFF_DECL_SPECIFIERS,
	TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE,
	TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION,
	TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS,
	TFF_TEMPLATE_NAME, TFF_EXPR_IN_PARENS, TFF_SCOPE): New macros.
	(type_as_string, decl_as_string, expr_as_string,
	context_as_string): Adjust prototype.

	* class.c (dump_class_hierarchy_r): Use TFF_PLAIN_IDENTIFIER
	instead of TS_PLAIN.

	* pt.c (mangle_class_name_for_template): Use TFF_CHASE_TYPEDEF
	instead of TF_CHASE_TYPEDEFS. Use TFF_PLAIN_IDENTIFIER instead of
	plain `0'.

From-SVN: r37152
parent 34791641
2000-10-31 Gabriel Dos Reis <gdr@codesourcery.com>
* error.c: Move TFF_ macros into cp-tree.h. Throughout, replace
TS_* flags with corresponding TFF_*. Adjust prototypes of
functions (which used to take a tree_string_flags) to take an int.
* cp-tree.h (enum tree_string_flags): Remove
(TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE,
TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPEDEF, TFF_DECL_SPECIFIERS,
TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE,
TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION,
TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS,
TFF_TEMPLATE_NAME, TFF_EXPR_IN_PARENS, TFF_SCOPE): New macros.
(type_as_string, decl_as_string, expr_as_string,
context_as_string): Adjust prototype.
* class.c (dump_class_hierarchy_r): Use TFF_PLAIN_IDENTIFIER
instead of TS_PLAIN.
* pt.c (mangle_class_name_for_template): Use TFF_CHASE_TYPEDEF
instead of TF_CHASE_TYPEDEFS. Use TFF_PLAIN_IDENTIFIER instead of
plain `0'.
2000-10-30 Mark Mitchell <mark@codesourcery.com> 2000-10-30 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (DECL_EXTERNAL_LINKAGE_P): New macro. * cp-tree.h (DECL_EXTERNAL_LINKAGE_P): New macro.
......
...@@ -6665,7 +6665,7 @@ dump_class_hierarchy_r (t, binfo, indent) ...@@ -6665,7 +6665,7 @@ dump_class_hierarchy_r (t, binfo, indent)
fprintf (stderr, "%*s0x%lx (%s) ", indent, "", fprintf (stderr, "%*s0x%lx (%s) ", indent, "",
(unsigned long) binfo, (unsigned long) binfo,
type_as_string (binfo, TS_PLAIN)); type_as_string (binfo, TFF_PLAIN_IDENTIFIER));
fprintf (stderr, HOST_WIDE_INT_PRINT_DEC, fprintf (stderr, HOST_WIDE_INT_PRINT_DEC,
tree_low_cst (BINFO_OFFSET (binfo), 0)); tree_low_cst (BINFO_OFFSET (binfo), 0));
if (TREE_VIA_VIRTUAL (binfo)) if (TREE_VIA_VIRTUAL (binfo))
......
...@@ -3674,29 +3674,42 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; ...@@ -3674,29 +3674,42 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
#define TEMPLATE_TYPE_DECL(NODE) \ #define TEMPLATE_TYPE_DECL(NODE) \
(TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE))) (TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
/* Control stringification of trees (types, decls & exprs). /* These constants can used as bit flags in the process of tree formatting.
Bit or them together. */
enum tree_string_flags TFF_PLAIN_IDENTIFIER: unqualified part of a name.
{ TFF_NAMESPACE_SCOPE: the complete qualified-id form of a name.
TS_PLAIN, /* nothing special */ TFF_CLASS_SCOPE: if possible, include the class-name part of a
TS_CHASE_TYPEDEFS = 1 << 0, /* look through typedefs */ qualified-id. This flag may be implied in some circumstances by
TS_DECORATE = 1 << 1, /* decorate things */ TFF_NAMESPACE_SCOPE.
TS_FUNC_NORETURN = 1 << 2, /* inhibit function return type */ TFF_SCOPE: the combinaison of the two above.
TS_FUNC_THROW = 1 << 3, /* show throw spec */ TFF_CHASE_TYPEDEF: print the original type-id instead of the typedef-name.
TS_PARM_DEFAULTS = 1 << 4, /* show parm defaults */ TFF_DECL_SPECIFIERS: print decl-specifiers.
TS_EXPR_PARENS = 1 << 5, /* enclose in parens */ TFF_CLASS_KEY_OR_ENUM: precede a class-type name (resp. enum name) with
TS_AGGR_TAGS = 1 << 6, /* show struct tags */ a class-key (resp. `enum').
TS_DECL_TYPE = 1 << 7, /* show decl's type */ TFF_RETURN_TYPE: include function return type.
TS_FUNC_SCOPE = 1 << 8, /* show function scope */ TFF_FUNCTION_DEFAULT_ARGUMENTS: include function default parameter values.
TS_PEDANTIC_NAME = 1 << 9, /* pedantically name things */ TFF_EXCEPTION_SPECIFICATION: show function exception specification.
TS_TEMPLATE_PREFIX= 1 << 10, /* show template <parms> prefix */ TFF_TEMPLATE_HEADER: show the template<...> hearder in a
template-declaration.
/* Internal use flags */ TFF_TEMPLATE_DEFAULT_ARGUMENTS: show template paramter default values.
TS_TEMPLATE_PARM = 1 << 11, /* decl is really a non-type template parm */ TFF_TEMPLATE_NAME: show only template-name.
TS_TEMPLATE_PLAIN = 1 << 12, /* don't decorate primary template_name */ TFF_EXPR_IN_PARENS: Parenthesize expressions. */
TS_NEXT_BIT = 13 /* next available bit */ #define TFF_PLAIN_IDENTIFIER (0)
}; #define TFF_NAMESPACE_SCOPE (1)
#define TFF_CLASS_SCOPE (1 << 1)
#define TFF_CHASE_NAMESPACE_ALIAS (1 << 2)
#define TFF_CHASE_TYPEDEF (1 << 3)
#define TFF_DECL_SPECIFIERS (1 << 4)
#define TFF_CLASS_KEY_OR_ENUM (1 << 5)
#define TFF_RETURN_TYPE (1 << 6)
#define TFF_FUNCTION_DEFAULT_ARGUMENTS (1 << 7)
#define TFF_EXCEPTION_SPECIFICATION (1 << 8)
#define TFF_TEMPLATE_HEADER (1 << 9)
#define TFF_TEMPLATE_DEFAULT_ARGUMENTS (1 << 10)
#define TFF_TEMPLATE_NAME (1 << 11)
#define TFF_EXPR_IN_PARENS (1 << 12)
#define TFF_SCOPE (TFF_NAMESPACE_SCOPE | TFF_CLASS_SCOPE)
/* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM /* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM
node. */ node. */
...@@ -4032,10 +4045,10 @@ extern void cp_deprecated PARAMS ((const char*)); ...@@ -4032,10 +4045,10 @@ extern void cp_deprecated PARAMS ((const char*));
/* in error.c */ /* in error.c */
extern void init_error PARAMS ((void)); extern void init_error PARAMS ((void));
extern const char *type_as_string PARAMS ((tree, enum tree_string_flags)); extern const char *type_as_string PARAMS ((tree, int));
extern const char *decl_as_string PARAMS ((tree, enum tree_string_flags)); extern const char *decl_as_string PARAMS ((tree, int));
extern const char *expr_as_string PARAMS ((tree, enum tree_string_flags)); extern const char *expr_as_string PARAMS ((tree, int));
extern const char *context_as_string PARAMS ((tree, enum tree_string_flags)); extern const char *context_as_string PARAMS ((tree, int));
extern const char *lang_decl_name PARAMS ((tree, int)); extern const char *lang_decl_name PARAMS ((tree, int));
extern const char *cp_file_of PARAMS ((tree)); extern const char *cp_file_of PARAMS ((tree));
extern int cp_line_of PARAMS ((tree)); extern int cp_line_of PARAMS ((tree));
......
...@@ -3534,7 +3534,7 @@ mangle_class_name_for_template (name, parms, arglist) ...@@ -3534,7 +3534,7 @@ mangle_class_name_for_template (name, parms, arglist)
if (TREE_CODE (parm) == TYPE_DECL) if (TREE_CODE (parm) == TYPE_DECL)
{ {
cat (type_as_string (arg, TS_CHASE_TYPEDEFS)); cat (type_as_string (arg, TFF_CHASE_TYPEDEF));
continue; continue;
} }
else if (TREE_CODE (parm) == TEMPLATE_DECL) else if (TREE_CODE (parm) == TEMPLATE_DECL)
...@@ -3551,14 +3551,14 @@ mangle_class_name_for_template (name, parms, arglist) ...@@ -3551,14 +3551,14 @@ mangle_class_name_for_template (name, parms, arglist)
my_friendly_assert (TREE_CODE (context) == NAMESPACE_DECL my_friendly_assert (TREE_CODE (context) == NAMESPACE_DECL
|| CLASS_TYPE_P (context), || CLASS_TYPE_P (context),
980422); 980422);
cat(decl_as_string (DECL_CONTEXT (arg), 0)); cat(decl_as_string (DECL_CONTEXT (arg), TFF_PLAIN_IDENTIFIER));
cat("::"); cat("::");
} }
cat (IDENTIFIER_POINTER (DECL_NAME (arg))); cat (IDENTIFIER_POINTER (DECL_NAME (arg)));
} }
else else
/* Output the parameter declaration */ /* Output the parameter declaration */
cat (type_as_string (arg, TS_CHASE_TYPEDEFS)); cat (type_as_string (arg, TFF_CHASE_TYPEDEF));
continue; continue;
} }
else else
...@@ -3573,7 +3573,7 @@ mangle_class_name_for_template (name, parms, arglist) ...@@ -3573,7 +3573,7 @@ mangle_class_name_for_template (name, parms, arglist)
} }
/* No need to check arglist against parmlist here; we did that /* No need to check arglist against parmlist here; we did that
in coerce_template_parms, called from lookup_template_class. */ in coerce_template_parms, called from lookup_template_class. */
cat (expr_as_string (arg, 0)); cat (expr_as_string (arg, TFF_PLAIN_IDENTIFIER));
} }
{ {
char *bufp = obstack_next_free (&scratch_obstack); char *bufp = obstack_next_free (&scratch_obstack);
......
2000-10-31 Gabriel Dos Reis <gdr@codesourcery.com>
* g++.old-deja/g++.pt/memtemp77.C (main): Adjust comparison against.
__PRETTY_FUNCTION__
2000-10-29 Neil Booth <neilb@earthling.net> 2000-10-29 Neil Booth <neilb@earthling.net>
* gcc.dg/cpp/defined.c, include1.c, paste11.c, skipping.c: * gcc.dg/cpp/defined.c, include1.c, paste11.c, skipping.c:
......
...@@ -18,7 +18,7 @@ const char* S3<char>::h(int) { return __PRETTY_FUNCTION__; } ...@@ -18,7 +18,7 @@ const char* S3<char>::h(int) { return __PRETTY_FUNCTION__; }
int main() int main()
{ {
if (strcmp (S3<double>::h(7), if (strcmp (S3<double>::h(7),
"const char* S3<T>::h(U) [with U = int, T = double]") == 0) "static const char* S3<T>::h(U) [with U = int, T = double]") == 0)
return 0; return 0;
else else
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment