Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

188 lines
9.0KB

  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>GIMPLE sequences (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="GIMPLE sequences (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="GIMPLE sequences (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="GIMPLE.html#GIMPLE" rel="up" title="GIMPLE">
  30. <link href="Sequence-iterators.html#Sequence-iterators" rel="next" title="Sequence iterators">
  31. <link href="GIMPLE_005fWITH_005fCLEANUP_005fEXPR.html#GIMPLE_005fWITH_005fCLEANUP_005fEXPR" rel="prev" title="GIMPLE_WITH_CLEANUP_EXPR">
  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="GIMPLE-sequences"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Sequence-iterators.html#Sequence-iterators" accesskey="n" rel="next">Sequence iterators</a>, Previous: <a href="Tuple-specific-accessors.html#Tuple-specific-accessors" accesskey="p" rel="prev">Tuple specific accessors</a>, Up: <a href="GIMPLE.html#GIMPLE" accesskey="u" rel="up">GIMPLE</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="GIMPLE-sequences-1"></a>
  68. <h3 class="section">12.9 GIMPLE sequences</h3>
  69. <a name="index-GIMPLE-sequences"></a>
  70. <p>GIMPLE sequences are the tuple equivalent of <code>STATEMENT_LIST</code>&rsquo;s
  71. used in <code>GENERIC</code>. They are used to chain statements together, and
  72. when used in conjunction with sequence iterators, provide a
  73. framework for iterating through statements.
  74. </p>
  75. <p>GIMPLE sequences are of type struct <code>gimple_sequence</code>, but are more
  76. commonly passed by reference to functions dealing with sequences.
  77. The type for a sequence pointer is <code>gimple_seq</code> which is the same
  78. as struct <code>gimple_sequence</code> *. When declaring a local sequence,
  79. you can define a local variable of type struct <code>gimple_sequence</code>.
  80. When declaring a sequence allocated on the garbage collected
  81. heap, use the function <code>gimple_seq_alloc</code> documented below.
  82. </p>
  83. <p>There are convenience functions for iterating through sequences
  84. in the section entitled Sequence Iterators.
  85. </p>
  86. <p>Below is a list of functions to manipulate and query sequences.
  87. </p>
  88. <dl>
  89. <dt><a name="index-gimple_005fseq_005fadd_005fstmt"></a>GIMPLE function: <em>void</em> <strong>gimple_seq_add_stmt</strong> <em>(gimple_seq *seq, gimple g)</em></dt>
  90. <dd><p>Link a gimple statement to the end of the sequence *<code>SEQ</code> if <code>G</code> is
  91. not <code>NULL</code>. If *<code>SEQ</code> is <code>NULL</code>, allocate a sequence before linking.
  92. </p></dd></dl>
  93. <dl>
  94. <dt><a name="index-gimple_005fseq_005fadd_005fseq"></a>GIMPLE function: <em>void</em> <strong>gimple_seq_add_seq</strong> <em>(gimple_seq *dest, gimple_seq src)</em></dt>
  95. <dd><p>Append sequence <code>SRC</code> to the end of sequence *<code>DEST</code> if <code>SRC</code> is not
  96. <code>NULL</code>. If *<code>DEST</code> is <code>NULL</code>, allocate a new sequence before
  97. appending.
  98. </p></dd></dl>
  99. <dl>
  100. <dt><a name="index-gimple_005fseq_005fdeep_005fcopy"></a>GIMPLE function: <em>gimple_seq</em> <strong>gimple_seq_deep_copy</strong> <em>(gimple_seq src)</em></dt>
  101. <dd><p>Perform a deep copy of sequence <code>SRC</code> and return the result.
  102. </p></dd></dl>
  103. <dl>
  104. <dt><a name="index-gimple_005fseq_005freverse"></a>GIMPLE function: <em>gimple_seq</em> <strong>gimple_seq_reverse</strong> <em>(gimple_seq seq)</em></dt>
  105. <dd><p>Reverse the order of the statements in the sequence <code>SEQ</code>. Return
  106. <code>SEQ</code>.
  107. </p></dd></dl>
  108. <dl>
  109. <dt><a name="index-gimple_005fseq_005ffirst"></a>GIMPLE function: <em>gimple</em> <strong>gimple_seq_first</strong> <em>(gimple_seq s)</em></dt>
  110. <dd><p>Return the first statement in sequence <code>S</code>.
  111. </p></dd></dl>
  112. <dl>
  113. <dt><a name="index-gimple_005fseq_005flast"></a>GIMPLE function: <em>gimple</em> <strong>gimple_seq_last</strong> <em>(gimple_seq s)</em></dt>
  114. <dd><p>Return the last statement in sequence <code>S</code>.
  115. </p></dd></dl>
  116. <dl>
  117. <dt><a name="index-gimple_005fseq_005fset_005flast"></a>GIMPLE function: <em>void</em> <strong>gimple_seq_set_last</strong> <em>(gimple_seq s, gimple last)</em></dt>
  118. <dd><p>Set the last statement in sequence <code>S</code> to the statement in <code>LAST</code>.
  119. </p></dd></dl>
  120. <dl>
  121. <dt><a name="index-gimple_005fseq_005fset_005ffirst"></a>GIMPLE function: <em>void</em> <strong>gimple_seq_set_first</strong> <em>(gimple_seq s, gimple first)</em></dt>
  122. <dd><p>Set the first statement in sequence <code>S</code> to the statement in <code>FIRST</code>.
  123. </p></dd></dl>
  124. <dl>
  125. <dt><a name="index-gimple_005fseq_005finit"></a>GIMPLE function: <em>void</em> <strong>gimple_seq_init</strong> <em>(gimple_seq s)</em></dt>
  126. <dd><p>Initialize sequence <code>S</code> to an empty sequence.
  127. </p></dd></dl>
  128. <dl>
  129. <dt><a name="index-gimple_005fseq_005falloc"></a>GIMPLE function: <em>gimple_seq</em> <strong>gimple_seq_alloc</strong> <em>(void)</em></dt>
  130. <dd><p>Allocate a new sequence in the garbage collected store and return
  131. it.
  132. </p></dd></dl>
  133. <dl>
  134. <dt><a name="index-gimple_005fseq_005fcopy"></a>GIMPLE function: <em>void</em> <strong>gimple_seq_copy</strong> <em>(gimple_seq dest, gimple_seq src)</em></dt>
  135. <dd><p>Copy the sequence <code>SRC</code> into the sequence <code>DEST</code>.
  136. </p></dd></dl>
  137. <dl>
  138. <dt><a name="index-gimple_005fseq_005fempty_005fp"></a>GIMPLE function: <em>bool</em> <strong>gimple_seq_empty_p</strong> <em>(gimple_seq s)</em></dt>
  139. <dd><p>Return true if the sequence <code>S</code> is empty.
  140. </p></dd></dl>
  141. <dl>
  142. <dt><a name="index-bb_005fseq"></a>GIMPLE function: <em>gimple_seq</em> <strong>bb_seq</strong> <em>(basic_block bb)</em></dt>
  143. <dd><p>Returns the sequence of statements in <code>BB</code>.
  144. </p></dd></dl>
  145. <dl>
  146. <dt><a name="index-set_005fbb_005fseq"></a>GIMPLE function: <em>void</em> <strong>set_bb_seq</strong> <em>(basic_block bb, gimple_seq seq)</em></dt>
  147. <dd><p>Sets the sequence of statements in <code>BB</code> to <code>SEQ</code>.
  148. </p></dd></dl>
  149. <dl>
  150. <dt><a name="index-gimple_005fseq_005fsingleton_005fp"></a>GIMPLE function: <em>bool</em> <strong>gimple_seq_singleton_p</strong> <em>(gimple_seq seq)</em></dt>
  151. <dd><p>Determine whether <code>SEQ</code> contains exactly one statement.
  152. </p></dd></dl>
  153. <hr>
  154. <div class="header">
  155. <p>
  156. Next: <a href="Sequence-iterators.html#Sequence-iterators" accesskey="n" rel="next">Sequence iterators</a>, Previous: <a href="Tuple-specific-accessors.html#Tuple-specific-accessors" accesskey="p" rel="prev">Tuple specific accessors</a>, Up: <a href="GIMPLE.html#GIMPLE" accesskey="u" rel="up">GIMPLE</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>
  157. </div>
  158. </body>
  159. </html>