diff options
author | Mike Stump <mrs@gcc.gnu.org> | 1994-03-23 23:33:53 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 1994-03-23 23:33:53 +0000 |
commit | 51c184be092792a7df35662dee52448c7b17fcb3 (patch) | |
tree | 50fb55018ee5664cebe5d87e245abecdf1af7630 /gcc/cp/tree.c | |
parent | d7a58f30d1ba7672aeee5a6c68c8dd56690601e7 (diff) | |
download | gcc-51c184be092792a7df35662dee52448c7b17fcb3.zip gcc-51c184be092792a7df35662dee52448c7b17fcb3.tar.gz gcc-51c184be092792a7df35662dee52448c7b17fcb3.tar.bz2 |
30th Cygnus<->FSF merge.
From-SVN: r6859
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 107 |
1 files changed, 40 insertions, 67 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 4edcabc..785033c 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -83,13 +83,8 @@ lvalue_p (ref) case OFFSET_REF: if (TREE_CODE (TREE_OPERAND (ref, 1)) == FUNCTION_DECL) return 1; - if (TREE_CODE (TREE_OPERAND (ref, 1)) == VAR_DECL) - if (TREE_READONLY (ref) && ! TREE_STATIC (ref) - && DECL_LANG_SPECIFIC (ref) - && DECL_IN_AGGR_P (ref)) - return 0; - else - return 1; + return lvalue_p (TREE_OPERAND (ref, 0)) + && lvalue_p (TREE_OPERAND (ref, 1)); break; case ADDR_EXPR: @@ -940,42 +935,52 @@ hash_chainon (list1, list2) hash_chainon (TREE_CHAIN (list1), list2)); } -tree -get_decl_list (value) +static tree +get_identifier_list (value) tree value; { - tree list = NULL_TREE; - - if (TREE_CODE (value) == IDENTIFIER_NODE) + tree list = IDENTIFIER_AS_LIST (value); + if (list != NULL_TREE + && (TREE_CODE (list) != TREE_LIST + || TREE_VALUE (list) != value)) + list = NULL_TREE; + else if (IDENTIFIER_HAS_TYPE_VALUE (value) + && TREE_CODE (IDENTIFIER_TYPE_VALUE (value)) == RECORD_TYPE) { - list = IDENTIFIER_AS_LIST (value); - if (list != NULL_TREE - && (TREE_CODE (list) != TREE_LIST - || TREE_VALUE (list) != value)) + tree type = IDENTIFIER_TYPE_VALUE (value); + + if (TYPE_PTRMEMFUNC_P (type)) list = NULL_TREE; - else if (IDENTIFIER_HAS_TYPE_VALUE (value) - && TREE_CODE (IDENTIFIER_TYPE_VALUE (value)) == RECORD_TYPE) + else if (type == current_class_type) + /* Don't mess up the constructor name. */ + list = tree_cons (NULL_TREE, value, NULL_TREE); + else { register tree id; - tree type = IDENTIFIER_TYPE_VALUE (value); - - if (TYPE_PTRMEMFUNC_P (type)) - list = NULL_TREE; + /* This will return the correct thing for regular types, + nested types, and templates. Yay! */ + if (TYPE_NESTED_NAME (type)) + id = TYPE_NESTED_NAME (type); else - { - /* This will return the correct thing for regular types, - nested types, and templates. Yay! */ - if (DECL_NESTED_TYPENAME (TYPE_NAME (type))) - value = DECL_NESTED_TYPENAME (TYPE_NAME (type)); - id = value; - - if (CLASSTYPE_ID_AS_LIST (type) == NULL_TREE) - CLASSTYPE_ID_AS_LIST (type) = perm_tree_cons (NULL_TREE, - id, NULL_TREE); - list = CLASSTYPE_ID_AS_LIST (type); - } + id = TYPE_IDENTIFIER (type); + + if (CLASSTYPE_ID_AS_LIST (type) == NULL_TREE) + CLASSTYPE_ID_AS_LIST (type) + = perm_tree_cons (NULL_TREE, id, NULL_TREE); + list = CLASSTYPE_ID_AS_LIST (type); } } + return list; +} + +tree +get_decl_list (value) + tree value; +{ + tree list = NULL_TREE; + + if (TREE_CODE (value) == IDENTIFIER_NODE) + list = get_identifier_list (value); else if (TREE_CODE (value) == RECORD_TYPE && TYPE_LANG_SPECIFIC (value)) list = CLASSTYPE_AS_LIST (value); @@ -1003,39 +1008,7 @@ list_hash_lookup_or_cons (value) tree list = NULL_TREE; if (TREE_CODE (value) == IDENTIFIER_NODE) - { - list = IDENTIFIER_AS_LIST (value); - if (list != NULL_TREE - && (TREE_CODE (list) != TREE_LIST - || TREE_VALUE (list) != value)) - list = NULL_TREE; - else if (IDENTIFIER_HAS_TYPE_VALUE (value) - && TREE_CODE (IDENTIFIER_TYPE_VALUE (value)) == RECORD_TYPE) - { - /* If the type name and constructor name are different, don't - write constructor name into type. */ - if (identifier_typedecl_value (value) - && identifier_typedecl_value (value) != constructor_name (value)) - list = tree_cons (NULL_TREE, value, NULL_TREE); - else - { - tree type = IDENTIFIER_TYPE_VALUE (value); - if (TYPE_PTRMEMFUNC_P (type)) - list = NULL_TREE; - else - { - if (CLASSTYPE_ID_AS_LIST (type) == NULL_TREE) - { - /* Not just `value', which could be a template parm. */ - tree id = DECL_NAME (TYPE_NAME (type)); - CLASSTYPE_ID_AS_LIST (type) = - perm_tree_cons (NULL_TREE, id, NULL_TREE); - } - list = CLASSTYPE_ID_AS_LIST (type); - } - } - } - } + list = get_identifier_list (value); else if (TREE_CODE (value) == TYPE_DECL && TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE && TYPE_LANG_SPECIFIC (TREE_TYPE (value))) |