summaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 20805d5cef3..ff608db5360 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4654,11 +4654,9 @@ decl_function_context (decl)
while (context && TREE_CODE (context) != FUNCTION_DECL)
{
- if (TREE_CODE (context) == RECORD_TYPE
- || TREE_CODE (context) == UNION_TYPE
- || TREE_CODE (context) == QUAL_UNION_TYPE)
+ if (TREE_CODE_CLASS (TREE_CODE (context)) == 't')
context = TYPE_CONTEXT (context);
- else if (TREE_CODE (context) == TYPE_DECL)
+ else if (TREE_CODE_CLASS (TREE_CODE (context)) == 'd')
context = DECL_CONTEXT (context);
else if (TREE_CODE (context) == BLOCK)
context = BLOCK_SUPERCONTEXT (context);