GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

引数[]

概要[]

5211 /* Create a complex type whose components are COMPONENT_TYPE.  */
5212 
5213 tree
5214 build_complex_type (tree component_type)
5215 {
5216   tree t;
5217   hashval_t hashcode;
5218 
5219   /* Make a node of the sort we want.  */
5220   t = make_node (COMPLEX_TYPE);
5221 
5222   TREE_TYPE (t) = TYPE_MAIN_VARIANT (component_type);
5223 
5224   /* If we already have such a type, use the old one.  */
5225   hashcode = iterative_hash_object (TYPE_HASH (component_type), 0);
5226   t = type_hash_canon (hashcode, t);
5227 
5228   if (!COMPLETE_TYPE_P (t))
5229     layout_type (t);
5230 
5231   /* If we are writing Dwarf2 output we need to create a name,
5232      since complex is a fundamental type.  */
5233   if ((write_symbols == DWARF2_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG)
5234       && ! TYPE_NAME (t))
5235     {
5236       const char *name;
5237       if (component_type == char_type_node)
5238         name = "complex char";
5239       else if (component_type == signed_char_type_node)
5240         name = "complex signed char";
5241       else if (component_type == unsigned_char_type_node)
5242         name = "complex unsigned char";
5243       else if (component_type == short_integer_type_node)
5244         name = "complex short int";
5245       else if (component_type == short_unsigned_type_node)
5246         name = "complex short unsigned int";
5247       else if (component_type == integer_type_node)
5248         name = "complex int";
5249       else if (component_type == unsigned_type_node)
5250         name = "complex unsigned int";
5251       else if (component_type == long_integer_type_node)
5252         name = "complex long int";
5253       else if (component_type == long_unsigned_type_node)
5254         name = "complex long unsigned int";
5255       else if (component_type == long_long_integer_type_node)
5256         name = "complex long long int";
5257       else if (component_type == long_long_unsigned_type_node)
5258         name = "complex long long unsigned int";
5259       else
5260         name = 0;
5261 
5262       if (name != 0)
5263         TYPE_NAME (t) = get_identifier (name);
5264     }
5265 
5266   return build_qualified_type (t, TYPE_QUALS (component_type));
5267 }



リンク元

Advertisement