aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-streamer.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2016-10-17 17:56:22 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2016-10-17 17:56:22 +0200
commit80b841ba52a689712da44a91954c17a8aeace5c8 (patch)
tree2eb53f543881c5d45f7aa40d6daece5e288e9eb1 /gcc/tree-streamer.c
parent12d3f34b33bc41f5f3d010435fa7eb03fb344c5f (diff)
downloadgcc-80b841ba52a689712da44a91954c17a8aeace5c8.zip
gcc-80b841ba52a689712da44a91954c17a8aeace5c8.tar.gz
gcc-80b841ba52a689712da44a91954c17a8aeace5c8.tar.bz2
Explicitly list all tree codes in gcc/tree-streamer.c:record_common_node
gcc/ * tree-streamer.c (record_common_node): Explicitly list expected tree codes. From-SVN: r241246
Diffstat (limited to 'gcc/tree-streamer.c')
-rw-r--r--gcc/tree-streamer.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/gcc/tree-streamer.c b/gcc/tree-streamer.c
index 7ea7096..2139e96 100644
--- a/gcc/tree-streamer.c
+++ b/gcc/tree-streamer.c
@@ -277,12 +277,28 @@ record_common_node (struct streamer_tree_cache_d *cache, tree node)
in the cache as hash value. */
streamer_tree_cache_append (cache, node, cache->nodes.length ());
- if (POINTER_TYPE_P (node)
- || TREE_CODE (node) == COMPLEX_TYPE
- || TREE_CODE (node) == ARRAY_TYPE)
- record_common_node (cache, TREE_TYPE (node));
- else if (TREE_CODE (node) == RECORD_TYPE)
+ switch (TREE_CODE (node))
{
+ case ERROR_MARK:
+ case FIELD_DECL:
+ case FIXED_POINT_TYPE:
+ case IDENTIFIER_NODE:
+ case INTEGER_CST:
+ case INTEGER_TYPE:
+ case POINTER_BOUNDS_TYPE:
+ case REAL_TYPE:
+ case TREE_LIST:
+ case VOID_CST:
+ case VOID_TYPE:
+ /* No recursive trees. */
+ break;
+ case ARRAY_TYPE:
+ case COMPLEX_TYPE:
+ case POINTER_TYPE:
+ case REFERENCE_TYPE:
+ record_common_node (cache, TREE_TYPE (node));
+ break;
+ case RECORD_TYPE:
/* The FIELD_DECLs of structures should be shared, so that every
COMPONENT_REF uses the same tree node when referencing a field.
Pointer equality between FIELD_DECLs is used by the alias
@@ -291,6 +307,10 @@ record_common_node (struct streamer_tree_cache_d *cache, tree node)
nonoverlapping_component_refs_of_decl_p). */
for (tree f = TYPE_FIELDS (node); f; f = TREE_CHAIN (f))
record_common_node (cache, f);
+ break;
+ default:
+ /* Unexpected tree code. */
+ gcc_unreachable ();
}
}