GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

引数[]

  • const char *name

実装[]

1223 /* Open assembly code output file.  Do this even if -fsyntax-only is
1224    on, because then the driver will have provided the name of a
1225    temporary file or bit bucket for us.  NAME is the file specified on
1226    the command line, possibly NULL.  */
1227 static void
1228 init_asm_output (const char *name)
1229 {
1230   if (name == NULL && asm_file_name == 0)
1231     asm_out_file = stdout;
1232   else
1233     {
1234       if (asm_file_name == 0)
1235         {
1236           int len = strlen (dump_base_name);
1237           char *dumpname = xmalloc (len + 6);
1238           memcpy (dumpname, dump_base_name, len + 1);
1239           strip_off_ending (dumpname, len);
1240           strcat (dumpname, ".s");
1241           asm_file_name = dumpname;
1242         }
1243       if (!strcmp (asm_file_name, "-"))
1244         asm_out_file = stdout;
1245       else
1246         asm_out_file = fopen (asm_file_name, "w+b");
1247       if (asm_out_file == 0)
1248         fatal_error ("can%'t open %s for writing: %m", asm_file_name);
1249     }
1250 
1251   if (!flag_syntax_only)
1252     {
1253       targetm.asm_out.file_start ();
1254 
1255 #ifdef ASM_COMMENT_START
1256       if (flag_verbose_asm)
1257         {
1258           /* Print the list of options in effect.  */
1259           print_version (asm_out_file, ASM_COMMENT_START);
1260           print_switch_values (asm_out_file, 0, MAX_LINE,
1261                                ASM_COMMENT_START, " ", "\n");
1262           /* Add a blank line here so it appears in assembler output but not
1263              screen output.  */
1264           fprintf (asm_out_file, "\n");
1265         }
1266 #endif
1267     }
1268 }



リンク元

Advertisement