Changeset 589
- Timestamp:
- Aug 12, 2003, 2:13:57 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gcc/gcc/config/i386/emx.c
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r588 r589 35 35 #define PTR_SIZE (POINTER_SIZE / BITS_PER_UNIT) 36 36 #endif 37 #if 0 /* debug */ 38 const char *code(tree node) 39 { 40 if (node) 41 { 42 switch (TREE_CODE (node)) 43 { 44 case FUNCTION_TYPE: return "FUNCTION_TYPE"; 45 case FUNCTION_DECL: return "FUNCTION_DECL"; 46 case METHOD_TYPE: return "METHOD_TYPE"; 47 case FIELD_DECL: return "FIELD_DECL"; 48 case TYPE_DECL: return "TYPE_DECL"; 49 case POINTER_TYPE: return "POINTER_TYPE"; 50 case VOID_TYPE: return "VOID_TYPE"; 51 case INTEGER_TYPE: return "INTEGER_TYPE"; 52 case CHAR_TYPE: return "CHAR_TYPE"; 53 case SET_TYPE: return "SET_TYPE"; 54 case ARRAY_TYPE: return "ARRAY_TYPE"; 55 case RECORD_TYPE: return "RECORD_TYPE"; 56 case QUAL_UNION_TYPE: return "QUAL_UNION_TYPE"; 57 case UNION_TYPE: return "UNION_TYPE"; 58 default: 59 break; 60 } 61 } 62 return ""; 63 } 64 65 void dump (tree node) 66 { 67 const char *psz = ""; 68 tree type = TREE_TYPE (node); 69 tree type2 = type ? TREE_TYPE(type) : NULL; 70 71 fprintf(stderr, "dbg: node=%d %s type=%d %s type_type=%d %s\n", 72 TREE_CODE(node), code(node), 73 type ? TREE_CODE(type) : -1, code(type), 74 type2 ? TREE_CODE(type2) : -1, code(type2)); 75 } 76 #endif 37 77 38 78 tree ix86_handle_system_attribute (tree *node, tree name, tree args, … … 46 86 (void)args; (void)flags; 47 87 88 type = TREE_TYPE (*node); 48 89 if (DECL_P (*node)) 49 switch (TREE_CODE (type = TREE_TYPE (*node)))90 switch (TREE_CODE (type)) 50 91 { 51 92 case FUNCTION_TYPE: … … 75 116 goto warn; 76 117 } 118 else if (TREE_CODE (*node) == POINTER_TYPE && type) 119 { /* Pointer-to-a-function type is allowed */ 120 switch (TREE_CODE (type)) 121 { 122 case FUNCTION_TYPE: 123 case METHOD_TYPE: 124 break; 125 default: 126 goto warn; 127 } 128 } 77 129 else 78 130 { … … 80 132 IDENTIFIER_POINTER (name)); 81 133 *no_add_attrs = true; 134 /*dump(*node); */ 82 135 } 83 136 … … 88 141 int flags, bool *no_add_attrs) 89 142 { 90 tree id, type ;143 tree id, type, typeset; 91 144 size_t sl; 92 145 const char *oldsym; … … 95 148 (void)args; (void)flags; 96 149 150 typeset = NULL; 151 type = TREE_TYPE (*node); 97 152 if (DECL_P (*node)) 98 switch (TREE_CODE (type = TREE_TYPE (*node)))153 switch (TREE_CODE (type)) 99 154 { 100 155 case FUNCTION_TYPE: 101 156 case METHOD_TYPE: 102 case FIELD_DECL: 103 case TYPE_DECL: 157 typeset = type; 158 case FIELD_DECL: /* how come these needs mangling? */ 159 case TYPE_DECL: /* how come? */ 104 160 id = DECL_ASSEMBLER_NAME (*node); 105 161 /* Remove the leading underscore */ … … 118 174 goto warn; 119 175 /*@@@@@todo: not finished*/ 176 typeset = type; 120 177 break; 121 178 default: 122 179 goto warn; 123 180 } 181 else if (TREE_CODE (*node) == POINTER_TYPE && type) 182 { /* Pointer-to-a-function type is allowed */ 183 switch (TREE_CODE (type)) 184 { 185 case FUNCTION_TYPE: 186 case METHOD_TYPE: 187 typeset = type; 188 break; 189 default: 190 goto warn; 191 } 192 } 124 193 else 125 194 { … … 127 196 IDENTIFIER_POINTER (name)); 128 197 *no_add_attrs = true; 198 /*dump(*node); */ 199 } 200 201 /* attach attribute to type. */ 202 if (typeset) 203 { 204 id = tree_cons (name, args, NULL_TREE); 205 TYPE_ATTRIBUTES (typeset) = chainon (TYPE_ATTRIBUTES (typeset), id); 206 return id; 129 207 } 130 208 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.