このページを編集する際は,編集に関する方針に従ってください.
概要
- gcc-4.1.0/gcc/toplev.cにて定義
- 言語に固有の初期化.
1828 /* Language-dependent initialization. Returns nonzero on success. */
実装
1829 static int
1830 lang_dependent_init (const char *name)
1831 {
1832 location_t save_loc = input_location;
1833 if (dump_base_name == 0)
1834 dump_base_name = name && name[0] ? name : "gccdump";
1835
1836 /* Other front-end initialization. */
1837 #ifdef USE_MAPPED_LOCATION
1838 input_location = BUILTINS_LOCATION;
1839 #else
1840 input_filename = "<built-in>";
1841 input_line = 0;
1842 #endif
* 結局,回りまわって define されているだけで,lang_hooks.init() は,c_objc_common_init () を呼び出しているのと同じ.様々な言語に対応するために,非常に抽象的になっていて,まわりくどい.
参考サイト : https://www.codeblog.org/blog/ssato/20060304.html
1843 if (lang_hooks.init () == 0)
1844 return 0;
1845 input_location = save_loc;
1846
1847 init_asm_output (name);
1848
1849 /* These create various _DECL nodes, so need to be called after the
1850 front end is initialized. */
1851 init_eh ();
1852 init_optabs ();
1853
1854 /* The following initialization functions need to generate rtl, so
1855 provide a dummy function context for them. */
1856 init_dummy_function_start ();
1857 init_expr_once ();
1858 expand_dummy_function_end ();
1859
1860 /* If dbx symbol table desired, initialize writing it and output the
1861 predefined types. */
1862 timevar_push (TV_SYMOUT);
1863
1864 #if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO
1865 if (dwarf2out_do_frame ())
1866 dwarf2out_frame_init ();
1867 #endif
1868
1869 /* Now we have the correct original filename, we can initialize
1870 debug output. */
1871 (*debug_hooks->init) (name);
1872
1873 timevar_pop (TV_SYMOUT);
1874
1875 return 1;
1876 }