gcc-c-fe.def 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /* Interface between GCC C FE and GDB -*- c -*-
  2. Copyright (C) 2014-2022 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. /* Create a new "decl" in GCC. A decl is a declaration, basically a
  15. kind of symbol.
  16. NAME is the name of the new symbol. SYM_KIND is the kind of
  17. symbol being requested. SYM_TYPE is the new symbol's C type;
  18. except for labels, where this is not meaningful and should be
  19. zero. If SUBSTITUTION_NAME is not NULL, then a reference to this
  20. decl in the source will later be substituted with a dereference
  21. of a variable of the given name. Otherwise, for symbols having
  22. an address (e.g., functions), ADDRESS is the address. FILENAME
  23. and LINE_NUMBER refer to the symbol's source location. If this
  24. is not known, FILENAME can be NULL and LINE_NUMBER can be 0.
  25. This function returns the new decl. */
  26. GCC_METHOD7 (gcc_decl, build_decl,
  27. const char *, /* Argument NAME. */
  28. enum gcc_c_symbol_kind, /* Argument SYM_KIND. */
  29. gcc_type, /* Argument SYM_TYPE. */
  30. const char *, /* Argument SUBSTITUTION_NAME. */
  31. gcc_address, /* Argument ADDRESS. */
  32. const char *, /* Argument FILENAME. */
  33. unsigned int) /* Argument LINE_NUMBER. */
  34. /* Insert a GCC decl into the symbol table. DECL is the decl to
  35. insert. IS_GLOBAL is true if this is an outermost binding, and
  36. false if it is a possibly-shadowing binding. */
  37. GCC_METHOD2 (int /* bool */, bind,
  38. gcc_decl, /* Argument DECL. */
  39. int /* bool */) /* Argument IS_GLOBAL. */
  40. /* Insert a tagged type into the symbol table. NAME is the tag name
  41. of the type and TAGGED_TYPE is the type itself. TAGGED_TYPE must
  42. be either a struct, union, or enum type, as these are the only
  43. types that have tags. FILENAME and LINE_NUMBER refer to the type's
  44. source location. If this is not known, FILENAME can be NULL and
  45. LINE_NUMBER can be 0. */
  46. GCC_METHOD4 (int /* bool */, tagbind,
  47. const char *, /* Argument NAME. */
  48. gcc_type, /* Argument TAGGED_TYPE. */
  49. const char *, /* Argument FILENAME. */
  50. unsigned int) /* Argument LINE_NUMBER. */
  51. /* Return the type of a pointer to a given base type. */
  52. GCC_METHOD1 (gcc_type, build_pointer_type,
  53. gcc_type) /* Argument BASE_TYPE. */
  54. /* Create a new 'struct' type. Initially it has no fields. */
  55. GCC_METHOD0 (gcc_type, build_record_type)
  56. /* Create a new 'union' type. Initially it has no fields. */
  57. GCC_METHOD0 (gcc_type, build_union_type)
  58. /* Add a field to a struct or union type. FIELD_NAME is the field's
  59. name. FIELD_TYPE is the type of the field. BITSIZE and BITPOS
  60. indicate where in the struct the field occurs. */
  61. GCC_METHOD5 (int /* bool */, build_add_field,
  62. gcc_type, /* Argument RECORD_OR_UNION_TYPE. */
  63. const char *, /* Argument FIELD_NAME. */
  64. gcc_type, /* Argument FIELD_TYPE. */
  65. unsigned long, /* Argument BITSIZE. */
  66. unsigned long) /* Argument BITPOS. */
  67. /* After all the fields have been added to a struct or union, the
  68. struct or union type must be "finished". This does some final
  69. cleanups in GCC. */
  70. GCC_METHOD2 (int /* bool */, finish_record_or_union,
  71. gcc_type, /* Argument RECORD_OR_UNION_TYPE. */
  72. unsigned long) /* Argument SIZE_IN_BYTES. */
  73. /* Create a new 'enum' type. The new type initially has no
  74. associated constants. */
  75. GCC_METHOD1 (gcc_type, build_enum_type,
  76. gcc_type) /* Argument UNDERLYING_INT_TYPE. */
  77. /* Add a new constant to an enum type. NAME is the constant's
  78. name and VALUE is its value. */
  79. GCC_METHOD3 (int /* bool */, build_add_enum_constant,
  80. gcc_type, /* Argument ENUM_TYPE. */
  81. const char *, /* Argument NAME. */
  82. unsigned long) /* Argument VALUE. */
  83. /* After all the constants have been added to an enum, the type must
  84. be "finished". This does some final cleanups in GCC. */
  85. GCC_METHOD1 (int /* bool */, finish_enum_type,
  86. gcc_type) /* Argument ENUM_TYPE. */
  87. /* Create a new function type. RETURN_TYPE is the type returned by
  88. the function, and ARGUMENT_TYPES is a vector, of length NARGS, of
  89. the argument types. IS_VARARGS is true if the function is
  90. varargs. */
  91. GCC_METHOD3 (gcc_type, build_function_type,
  92. gcc_type, /* Argument RETURN_TYPE. */
  93. const struct gcc_type_array *, /* Argument ARGUMENT_TYPES. */
  94. int /* bool */) /* Argument IS_VARARGS. */
  95. /* Return an integer type with the given properties.
  96. Deprecated in v1, use int_type instead. */
  97. GCC_METHOD2 (gcc_type, int_type_v0,
  98. int /* bool */, /* Argument IS_UNSIGNED. */
  99. unsigned long) /* Argument SIZE_IN_BYTES. */
  100. /* Return a floating point type with the given properties.
  101. Deprecated in v1, use float_type instead. */
  102. GCC_METHOD1 (gcc_type, float_type_v0,
  103. unsigned long) /* Argument SIZE_IN_BYTES. */
  104. /* Return the 'void' type. */
  105. GCC_METHOD0 (gcc_type, void_type)
  106. /* Return the 'bool' type. */
  107. GCC_METHOD0 (gcc_type, bool_type)
  108. /* Create a new array type. If NUM_ELEMENTS is -1, then the array
  109. is assumed to have an unknown length. */
  110. GCC_METHOD2 (gcc_type, build_array_type,
  111. gcc_type, /* Argument ELEMENT_TYPE. */
  112. int) /* Argument NUM_ELEMENTS. */
  113. /* Create a new variably-sized array type. UPPER_BOUND_NAME is the
  114. name of a local variable that holds the upper bound of the array;
  115. it is one less than the array size. */
  116. GCC_METHOD2 (gcc_type, build_vla_array_type,
  117. gcc_type, /* Argument ELEMENT_TYPE. */
  118. const char *) /* Argument UPPER_BOUND_NAME. */
  119. /* Return a qualified variant of a given base type. QUALIFIERS says
  120. which qualifiers to use; it is composed of or'd together
  121. constants from 'enum gcc_qualifiers'. */
  122. GCC_METHOD2 (gcc_type, build_qualified_type,
  123. gcc_type, /* Argument UNQUALIFIED_TYPE. */
  124. enum gcc_qualifiers) /* Argument QUALIFIERS. */
  125. /* Build a complex type given its element type. */
  126. GCC_METHOD1 (gcc_type, build_complex_type,
  127. gcc_type) /* Argument ELEMENT_TYPE. */
  128. /* Build a vector type given its element type and number of
  129. elements. */
  130. GCC_METHOD2 (gcc_type, build_vector_type,
  131. gcc_type, /* Argument ELEMENT_TYPE. */
  132. int) /* Argument NUM_ELEMENTS. */
  133. /* Build a constant. NAME is the constant's name and VALUE is its
  134. value. FILENAME and LINE_NUMBER refer to the type's source
  135. location. If this is not known, FILENAME can be NULL and
  136. LINE_NUMBER can be 0. */
  137. GCC_METHOD5 (int /* bool */, build_constant,
  138. gcc_type, /* Argument TYPE. */
  139. const char *, /* Argument NAME. */
  140. unsigned long, /* Argument VALUE. */
  141. const char *, /* Argument FILENAME. */
  142. unsigned int) /* Argument LINE_NUMBER. */
  143. /* Emit an error and return an error type object. */
  144. GCC_METHOD1 (gcc_type, error,
  145. const char *) /* Argument MESSAGE. */
  146. /* Return an integer type with the given properties. If BUILTIN_NAME
  147. is non-NULL, it must name a builtin integral type with the given
  148. signedness and size, and that is the type that will be returned. */
  149. GCC_METHOD3 (gcc_type, int_type,
  150. int /* bool */, /* Argument IS_UNSIGNED. */
  151. unsigned long, /* Argument SIZE_IN_BYTES. */
  152. const char *) /* Argument BUILTIN_NAME. */
  153. /* Return the 'char' type, a distinct type from both 'signed char' and
  154. 'unsigned char' returned by int_type. */
  155. GCC_METHOD0 (gcc_type, char_type)
  156. /* Return a floating point type with the given properties. If BUILTIN_NAME
  157. is non-NULL, it must name a builtin integral type with the given
  158. signedness and size, and that is the type that will be returned. */
  159. GCC_METHOD2 (gcc_type, float_type,
  160. unsigned long, /* Argument SIZE_IN_BYTES. */
  161. const char *) /* Argument BUILTIN_NAME. */