Skip to content

valoran-M/Soya

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soya

A compiler from Soya to Mips

The documentation of Soya language is here

Args

  • -o [file] Name of output file

language

  • -Imp : Compilation of Imp file

debug

  • -dimp : Save generated Imp
  • -drtl : Save generated RTL
  • -dltl : Save generated LTL
  • -dlin : Save generated linearize
  • -dall : activate all debug

Compiler pass

Languages

  1. Soya Soya language
  2. Imp A simple imperative language.
  3. RTL A graph a representation of Imp with pseudos and physicals registers with 3-address operations.
  4. LTL Like RTL but with only physicals registers.
  5. Linear A linear representation of LTL

Pass

  1. type check Creates typed Soya AST.
  2. Soya2Imp Translate Soya to an simple iterative language (Imp).
  3. Imp2RTL Construction of the CFG, 3-address code generation.
  4. Const propagation Propagate constant with a static analysis.
  5. Call Convention Use real register to respect Call Convention.
  6. Dead node elimination Remove useless node when register destination is never used.
  7. RTL2LTL Register allocation
  8. linearize Linearization of the CFG
  9. Asm Gen Mips assembly code generation

Sources

  1. Jean-Christophe Filliâtre's compilation course poly
  2. Constant propagation with conditionals branches article

Thanks

  1. Gurvan for its help in allocating registers part
  2. Paul for its help in spelling