このページを編集する際は,編集に関する方針に従ってください.[]
概要[]
- gcc-4.1.0/gcc/tree-pretty-print.cにて定義
- 関数宣言のダンプ
- 引数の型情報などがダンプされる模様
引数[]
- pretty_printer *buffer
- tree node
- int spc
- int flags
実装[]
186 /* Dump a function declaration. NODE is the FUNCTION_TYPE. BUFFER, SPC and
187 FLAGS are as in dump_generic_node. */
188
189 static void
190 dump_function_declaration (pretty_printer *buffer, tree node,
191 int spc, int flags)
192 {
193 bool wrote_arg = false;
194 tree arg;
195
196 pp_space (buffer);
197 pp_character (buffer, '(');
198
199 /* Print the argument types. The last element in the list is a VOID_TYPE.
200 The following avoids printing the last element. */
201 arg = TYPE_ARG_TYPES (node);
202 while (arg && TREE_CHAIN (arg) && arg != error_mark_node)
203 {
204 wrote_arg = true;
*再帰的に呼び出し引数一つのダンプを行う
205 dump_generic_node (buffer, TREE_VALUE (arg), spc, flags, false);
*次の引数の宣言を得る
206 arg = TREE_CHAIN (arg);
207 if (TREE_CHAIN (arg) && TREE_CODE (TREE_CHAIN (arg)) == [[TREE_LIST>enum tree_code]])
208 {
209 pp_character (buffer, ',');
210 pp_space (buffer);
211 }
212 }
213
*引数が一つも無かったとき
214 if (!wrote_arg)
215 pp_string (buffer, "void");
216
217 pp_character (buffer, ')');
218 }