From 886de2d4dcf3ade25fb76c32522fd4aa2f9510b8 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Mon, 22 Mar 2004 20:55:07 +0000 Subject: [PATCH] dwarf2out.c (is_subrange_type): Minor code rework. * dwarf2out.c (is_subrange_type): Minor code rework. No behavior change. From-SVN: r79837 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 22 +++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9e06227a286..42375243777 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-03-22 Joel Brobecker + + * dwarf2out.c (is_subrange_type): Minor code rework. No behavior + change. + 2004-03-22 Jakub Jelinek PR c/14069 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b3dcda0c5c0..ad2bf63aaec 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8000,15 +8000,19 @@ is_subrange_type (tree type) { tree subtype = TREE_TYPE (type); - if (TREE_CODE (type) == INTEGER_TYPE - && subtype != NULL_TREE) - { - if (TREE_CODE (subtype) == INTEGER_TYPE) - return true; - if (TREE_CODE (subtype) == ENUMERAL_TYPE) - return true; - } - return false; + /* Subrange types are identified by the fact that they are integer + types, and that they have a subtype which is either an integer type + or an enumeral type. */ + + if (TREE_CODE (type) != INTEGER_TYPE + || subtype == NULL_TREE) + return false; + + if (TREE_CODE (subtype) != INTEGER_TYPE + && TREE_CODE (subtype) != ENUMERAL_TYPE) + return false; + + return true; } /* Given a pointer to a tree node for a subrange type, return a pointer -- 2.30.2