You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
7.7KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>C and C++ Trees (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="C and C++ Trees (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="C and C++ Trees (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="GENERIC.html#GENERIC" rel="up" title="GENERIC">
  30. <link href="Types-for-C_002b_002b.html#Types-for-C_002b_002b" rel="next" title="Types for C++">
  31. <link href="Language_002ddependent-trees.html#Language_002ddependent-trees" rel="prev" title="Language-dependent trees">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="C-and-C_002b_002b-Trees"></a>
  62. <div class="header">
  63. <p>
  64. Previous: <a href="Language_002ddependent-trees.html#Language_002ddependent-trees" accesskey="p" rel="prev">Language-dependent trees</a>, Up: <a href="GENERIC.html#GENERIC" accesskey="u" rel="up">GENERIC</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="C-and-C_002b_002b-Trees-1"></a>
  68. <h3 class="section">11.10 C and C++ Trees</h3>
  69. <p>This section documents the internal representation used by GCC to
  70. represent C and C++ source programs. When presented with a C or C++
  71. source program, GCC parses the program, performs semantic analysis
  72. (including the generation of error messages), and then produces the
  73. internal representation described here. This representation contains a
  74. complete representation for the entire translation unit provided as
  75. input to the front end. This representation is then typically processed
  76. by a code-generator in order to produce machine code, but could also be
  77. used in the creation of source browsers, intelligent editors, automatic
  78. documentation generators, interpreters, and any other programs needing
  79. the ability to process C or C++ code.
  80. </p>
  81. <p>This section explains the internal representation. In particular, it
  82. documents the internal representation for C and C++ source
  83. constructs, and the macros, functions, and variables that can be used to
  84. access these constructs. The C++ representation is largely a superset
  85. of the representation used in the C front end. There is only one
  86. construct used in C that does not appear in the C++ front end and that
  87. is the GNU &ldquo;nested function&rdquo; extension. Many of the macros documented
  88. here do not apply in C because the corresponding language constructs do
  89. not appear in C.
  90. </p>
  91. <p>The C and C++ front ends generate a mix of GENERIC trees and ones
  92. specific to C and C++. These language-specific trees are higher-level
  93. constructs than the ones in GENERIC to make the parser&rsquo;s job easier.
  94. This section describes those trees that aren&rsquo;t part of GENERIC as well
  95. as aspects of GENERIC trees that are treated in a language-specific
  96. manner.
  97. </p>
  98. <p>If you are developing a &ldquo;back end&rdquo;, be it is a code-generator or some
  99. other tool, that uses this representation, you may occasionally find
  100. that you need to ask questions not easily answered by the functions and
  101. macros available here. If that situation occurs, it is quite likely
  102. that GCC already supports the functionality you desire, but that the
  103. interface is simply not documented here. In that case, you should ask
  104. the GCC maintainers (via mail to <a href="mailto:gcc@gcc.gnu.org">gcc@gcc.gnu.org</a>) about
  105. documenting the functionality you require. Similarly, if you find
  106. yourself writing functions that do not deal directly with your back end,
  107. but instead might be useful to other people using the GCC front end, you
  108. should submit your patches for inclusion in GCC.
  109. </p>
  110. <table class="menu" border="0" cellspacing="0">
  111. <tr><td align="left" valign="top">&bull; <a href="Types-for-C_002b_002b.html#Types-for-C_002b_002b" accesskey="1">Types for C++</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Fundamental and aggregate types.
  112. </td></tr>
  113. <tr><td align="left" valign="top">&bull; <a href="Namespaces.html#Namespaces" accesskey="2">Namespaces</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Namespaces.
  114. </td></tr>
  115. <tr><td align="left" valign="top">&bull; <a href="Classes.html#Classes" accesskey="3">Classes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Classes.
  116. </td></tr>
  117. <tr><td align="left" valign="top">&bull; <a href="Functions-for-C_002b_002b.html#Functions-for-C_002b_002b" accesskey="4">Functions for C++</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Overloading and accessors for C++.
  118. </td></tr>
  119. <tr><td align="left" valign="top">&bull; <a href="Statements-for-C_002b_002b.html#Statements-for-C_002b_002b" accesskey="5">Statements for C++</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Statements specific to C and C++.
  120. </td></tr>
  121. <tr><td align="left" valign="top">&bull; <a href="C_002b_002b-Expressions.html#C_002b_002b-Expressions" accesskey="6">C++ Expressions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">From <code>typeid</code> to <code>throw</code>.
  122. </td></tr>
  123. </table>
  124. <hr>
  125. <div class="header">
  126. <p>
  127. Previous: <a href="Language_002ddependent-trees.html#Language_002ddependent-trees" accesskey="p" rel="prev">Language-dependent trees</a>, Up: <a href="GENERIC.html#GENERIC" accesskey="u" rel="up">GENERIC</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  128. </div>
  129. </body>
  130. </html>