Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

206 lines
10KB

  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>Dispatch Tables (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Dispatch Tables (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Dispatch Tables (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="Assembler-Format.html#Assembler-Format" rel="up" title="Assembler Format">
  30. <link href="Exception-Region-Output.html#Exception-Region-Output" rel="next" title="Exception Region Output">
  31. <link href="Instruction-Output.html#Instruction-Output" rel="prev" title="Instruction Output">
  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="Dispatch-Tables"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Exception-Region-Output.html#Exception-Region-Output" accesskey="n" rel="next">Exception Region Output</a>, Previous: <a href="Instruction-Output.html#Instruction-Output" accesskey="p" rel="prev">Instruction Output</a>, Up: <a href="Assembler-Format.html#Assembler-Format" accesskey="u" rel="up">Assembler Format</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="Output-of-Dispatch-Tables"></a>
  68. <h4 class="subsection">18.20.8 Output of Dispatch Tables</h4>
  69. <p>This concerns dispatch tables.
  70. </p>
  71. <a name="index-dispatch-table"></a>
  72. <dl>
  73. <dt><a name="index-ASM_005fOUTPUT_005fADDR_005fDIFF_005fELT"></a>Macro: <strong>ASM_OUTPUT_ADDR_DIFF_ELT</strong> <em>(<var>stream</var>, <var>body</var>, <var>value</var>, <var>rel</var>)</em></dt>
  74. <dd><p>A C statement to output to the stdio stream <var>stream</var> an assembler
  75. pseudo-instruction to generate a difference between two labels.
  76. <var>value</var> and <var>rel</var> are the numbers of two internal labels. The
  77. definitions of these labels are output using
  78. <code>(*targetm.asm_out.internal_label)</code>, and they must be printed in the same
  79. way here. For example,
  80. </p>
  81. <div class="smallexample">
  82. <pre class="smallexample">fprintf (<var>stream</var>, &quot;\t.word L%d-L%d\n&quot;,
  83. <var>value</var>, <var>rel</var>)
  84. </pre></div>
  85. <p>You must provide this macro on machines where the addresses in a
  86. dispatch table are relative to the table&rsquo;s own address. If defined, GCC
  87. will also use this macro on all machines when producing PIC.
  88. <var>body</var> is the body of the <code>ADDR_DIFF_VEC</code>; it is provided so that the
  89. mode and flags can be read.
  90. </p></dd></dl>
  91. <dl>
  92. <dt><a name="index-ASM_005fOUTPUT_005fADDR_005fVEC_005fELT"></a>Macro: <strong>ASM_OUTPUT_ADDR_VEC_ELT</strong> <em>(<var>stream</var>, <var>value</var>)</em></dt>
  93. <dd><p>This macro should be provided on machines where the addresses
  94. in a dispatch table are absolute.
  95. </p>
  96. <p>The definition should be a C statement to output to the stdio stream
  97. <var>stream</var> an assembler pseudo-instruction to generate a reference to
  98. a label. <var>value</var> is the number of an internal label whose
  99. definition is output using <code>(*targetm.asm_out.internal_label)</code>.
  100. For example,
  101. </p>
  102. <div class="smallexample">
  103. <pre class="smallexample">fprintf (<var>stream</var>, &quot;\t.word L%d\n&quot;, <var>value</var>)
  104. </pre></div>
  105. </dd></dl>
  106. <dl>
  107. <dt><a name="index-ASM_005fOUTPUT_005fCASE_005fLABEL"></a>Macro: <strong>ASM_OUTPUT_CASE_LABEL</strong> <em>(<var>stream</var>, <var>prefix</var>, <var>num</var>, <var>table</var>)</em></dt>
  108. <dd><p>Define this if the label before a jump-table needs to be output
  109. specially. The first three arguments are the same as for
  110. <code>(*targetm.asm_out.internal_label)</code>; the fourth argument is the
  111. jump-table which follows (a <code>jump_table_data</code> containing an
  112. <code>addr_vec</code> or <code>addr_diff_vec</code>).
  113. </p>
  114. <p>This feature is used on system V to output a <code>swbeg</code> statement
  115. for the table.
  116. </p>
  117. <p>If this macro is not defined, these labels are output with
  118. <code>(*targetm.asm_out.internal_label)</code>.
  119. </p></dd></dl>
  120. <dl>
  121. <dt><a name="index-ASM_005fOUTPUT_005fCASE_005fEND"></a>Macro: <strong>ASM_OUTPUT_CASE_END</strong> <em>(<var>stream</var>, <var>num</var>, <var>table</var>)</em></dt>
  122. <dd><p>Define this if something special must be output at the end of a
  123. jump-table. The definition should be a C statement to be executed
  124. after the assembler code for the table is written. It should write
  125. the appropriate code to stdio stream <var>stream</var>. The argument
  126. <var>table</var> is the jump-table insn, and <var>num</var> is the label-number
  127. of the preceding label.
  128. </p>
  129. <p>If this macro is not defined, nothing special is output at the end of
  130. the jump-table.
  131. </p></dd></dl>
  132. <dl>
  133. <dt><a name="index-TARGET_005fASM_005fPOST_005fCFI_005fSTARTPROC"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_POST_CFI_STARTPROC</strong> <em>(FILE *<var></var>, <var>tree</var>)</em></dt>
  134. <dd><p>This target hook is used to emit assembly strings required by the target
  135. after the .cfi_startproc directive. The first argument is the file stream to
  136. write the strings to and the second argument is the function&rsquo;s declaration. The
  137. expected use is to add more .cfi_* directives.
  138. </p>
  139. <p>The default is to not output any assembly strings.
  140. </p></dd></dl>
  141. <dl>
  142. <dt><a name="index-TARGET_005fASM_005fEMIT_005fUNWIND_005fLABEL"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_EMIT_UNWIND_LABEL</strong> <em>(FILE *<var>stream</var>, tree <var>decl</var>, int <var>for_eh</var>, int <var>empty</var>)</em></dt>
  143. <dd><p>This target hook emits a label at the beginning of each FDE. It
  144. should be defined on targets where FDEs need special labels, and it
  145. should write the appropriate label, for the FDE associated with the
  146. function declaration <var>decl</var>, to the stdio stream <var>stream</var>.
  147. The third argument, <var>for_eh</var>, is a boolean: true if this is for an
  148. exception table. The fourth argument, <var>empty</var>, is a boolean:
  149. true if this is a placeholder label for an omitted FDE.
  150. </p>
  151. <p>The default is that FDEs are not given nonlocal labels.
  152. </p></dd></dl>
  153. <dl>
  154. <dt><a name="index-TARGET_005fASM_005fEMIT_005fEXCEPT_005fTABLE_005fLABEL"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL</strong> <em>(FILE *<var>stream</var>)</em></dt>
  155. <dd><p>This target hook emits a label at the beginning of the exception table.
  156. It should be defined on targets where it is desirable for the table
  157. to be broken up according to function.
  158. </p>
  159. <p>The default is that no label is emitted.
  160. </p></dd></dl>
  161. <dl>
  162. <dt><a name="index-TARGET_005fASM_005fEMIT_005fEXCEPT_005fPERSONALITY"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_EMIT_EXCEPT_PERSONALITY</strong> <em>(rtx <var>personality</var>)</em></dt>
  163. <dd><p>If the target implements <code>TARGET_ASM_UNWIND_EMIT</code>, this hook may be used to emit a directive to install a personality hook into the unwind info. This hook should not be used if dwarf2 unwind info is used.
  164. </p></dd></dl>
  165. <dl>
  166. <dt><a name="index-TARGET_005fASM_005fUNWIND_005fEMIT"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_UNWIND_EMIT</strong> <em>(FILE *<var>stream</var>, rtx_insn *<var>insn</var>)</em></dt>
  167. <dd><p>This target hook emits assembly directives required to unwind the
  168. given instruction. This is only used when <code>TARGET_EXCEPT_UNWIND_INFO</code>
  169. returns <code>UI_TARGET</code>.
  170. </p></dd></dl>
  171. <dl>
  172. <dt><a name="index-TARGET_005fASM_005fUNWIND_005fEMIT_005fBEFORE_005fINSN"></a>Target Hook: <em>bool</em> <strong>TARGET_ASM_UNWIND_EMIT_BEFORE_INSN</strong></dt>
  173. <dd><p>True if the <code>TARGET_ASM_UNWIND_EMIT</code> hook should be called before the assembly for <var>insn</var> has been emitted, false if the hook should be called afterward.
  174. </p></dd></dl>
  175. <hr>
  176. <div class="header">
  177. <p>
  178. Next: <a href="Exception-Region-Output.html#Exception-Region-Output" accesskey="n" rel="next">Exception Region Output</a>, Previous: <a href="Instruction-Output.html#Instruction-Output" accesskey="p" rel="prev">Instruction Output</a>, Up: <a href="Assembler-Format.html#Assembler-Format" accesskey="u" rel="up">Assembler Format</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>
  179. </div>
  180. </body>
  181. </html>