[Rewrite] Refactored string prologue/epilogues
authorthefiddler <stapostol@gmail.com>
Mon, 7 Jul 2014 11:16:17 +0000 (13:16 +0200)
committerthefiddler <stapostol@gmail.com>
Mon, 7 Jul 2014 11:16:17 +0000 (13:16 +0200)
commitc32bf4ec5de81bfc2c1a3b00ac8a5b8ff6cb69fb
treece6bcd0605e819c83020cc7eaa28e1b44449dbdf
parentc8a5bf5e3230f3f035efdd4fc8ec6ef8da2b7e4f
[Rewrite] Refactored string prologue/epilogues

We currently have three categories of string parameters: `string`,
`string[]` and `StringBuilder`. (OpenTK 1.2 adds one more: `ref
string`.) Each category needs to be marshaled separately into a native
character array.

This commit implements the following changes:
- string[] epilogues are now correctly emitted, instead of being
ignored.
- string[] prologues and epilogues now use the same local variable name.
- all epilogues are now generated with a single pass over the function
parameters, instead of requiring a separate pass for each category.
- string prologues and epilogues now allocate local variables based on
the relevant parameter *name* rather than the parameter *type*.

Fixes issue #144.
Source/Generator.Rewrite/Program.cs