Build implements the compiler.Plugin interface.
(c *compiler.C)
| 54 | |
| 55 | // Build implements the compiler.Plugin interface. |
| 56 | func (e *encoder) Build(c *compiler.C) { |
| 57 | *e = encoder{ |
| 58 | C: c, |
| 59 | funcs: funcs{ |
| 60 | encodeToBuf: map[*semantic.Class]*codegen.Function{}, |
| 61 | }, |
| 62 | entities: entities{ |
| 63 | types: map[semantic.Type]*entity{}, |
| 64 | funcParams: map[*semantic.Function]*entity{}, |
| 65 | funcCalls: map[*semantic.Function]*entity{}, |
| 66 | state: map[*semantic.API]*entity{}, |
| 67 | }, |
| 68 | } |
| 69 | |
| 70 | e.parseCallbacks() |
| 71 | |
| 72 | e.entities.build(e) |
| 73 | |
| 74 | e.buildWriteFuncs() |
| 75 | e.buildEncoderFuncs() |
| 76 | } |
| 77 | |
| 78 | func (e *encoder) buildWriteFuncs() { |
| 79 | e.funcs.writeVarint = e.M.Function(e.T.Void, "write_varint", e.T.CtxPtr, e.T.BufPtr, e.T.Uint64). |
nothing calls this directly
no test coverage detected