assyrianic / Tagha

Minimal, low-level, fast, and self-contained register-based bytecode virtual machine/runtime environment.
MIT License
124 stars 8 forks source link

Create MELT (GCC) plugin for GIMPLE -> TASM or #29

Open assyrianic opened 6 years ago

assyrianic commented 6 years ago

From this stack overflow link

Necrolis

You might find it easier to write a plugin for GCC, which would allow you to hook the GIMPLE generation and alter it inside GCC, which should drop the downtime of saving, editing then trying to compiler from GIMPLE form. MELT is one such plugin (though it offers way more than just altering the lower level representations). There is also a nice PDF here on GIMPLE altering plugins.

Else, you can look here for information on how GCC's GIMPLE works. In terms of dumping GIMPLE out:

You can request to dump a C-like representation of the GIMPLE form with the flag -fdump-tree-gimple.

Links: gcc plugins gcc plugins pdf GIMPLE info