Skip to content
Snippets Groups Projects
Commit d180a552 authored by Patrick Palka's avatar Patrick Palka
Browse files

c++: make strip_typedefs generalize strip_typedefs_expr

Currently if we have a TREE_VEC of types that we want to strip of typedefs,
we unintuitively need to call strip_typedefs_expr instead of strip_typedefs
since only strip_typedefs_expr handles TREE_VEC, and it also dispatches
to strip_typedefs when given a type.  But this seems backwards: arguably
strip_typedefs_expr should be the more specialized function, which
strip_typedefs dispatches to (and thus generalizes).

So this patch makes strip_typedefs subsume strip_typedefs_expr rather
than vice versa, which allows for some simplifications.

gcc/cp/ChangeLog:

	* tree.cc (strip_typedefs): Move TREE_LIST handling to
	strip_typedefs_expr.  Dispatch to strip_typedefs_expr for
	non-type 't'.
	<case TYPENAME_TYPE>: Remove manual dispatching to
	strip_typedefs_expr.
	<case TRAIT_TYPE>: Likewise.
	(strip_typedefs_expr): Replaces calls to strip_typedefs_expr
	with strip_typedefs throughout.  Don't dispatch to strip_typedefs
	for type 't'.
	<case TREE_LIST>: Replace this with the better version from
	strip_typedefs.
parent d4e8523b
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment