Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cmplstofB/d184521330d411bdf5cf395b648e920a to your computer and use it in GitHub Desktop.
Save cmplstofB/d184521330d411bdf5cf395b648e920a to your computer and use it in GitHub Desktop.
C言語の原稿がビルドされ実行可能ファイルになるまで(個人用控え)

C言語の原稿がビルドされ実行可能ファイルになるまで(個人用控え)

大まかな流れ

原稿(prog.c)
↓前処理(前処理機; cpp(1))マクロ・ファイルなどを展開
前処理済みの原稿(prog.i)
| ↓中間言語
| 中間言語による原稿
↓翻訳(翻訳機; ccom(1))☆
アセンブリ原稿(prog.s)
↓アセンブル処理(アセンブラ; as(1))
機械語(prog.o)
↓リンク(リンケージエディタ; ld(1))
実行可能ファイル(prog.x)

また,最適化が各段階で行なわれる。

☆部分の詳細

前処理済みの原稿
↓字句解析
構文木
構文解析
↓意味解析
抽象構文木
↓
中間表現
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment