diff --git a/notes/Copy-and-Patch Compilation.md b/notes/Copy-and-Patch Compilation.md index 16b113c..e825bd4 100644 --- a/notes/Copy-and-Patch Compilation.md +++ b/notes/Copy-and-Patch Compilation.md @@ -31,8 +31,12 @@ Clang + LLVM compiler infrastructure to hide all platform-specific low-level det MetaVar can generate binary stencils of different optimization levels for every bytecode or AST node, which the generator can select from at generation time. As am example, if the instruction is for adding a constant to a literal, the generator can select from addition implementations for the most optimized variant. It can also make register allocation decisions by keeping track of register availability and picking between stack instructions and register instructions. -### Interface -MetaVar constructs the stencil library +### Stencil Library Construction +MetaVar constructs the stencil library from programmer defined *stencil generators*. One stencil generator is defined for every AST node using C++ template meta-variables to express variants, and special macros to express missing values to be patched at runtime. + +At compile time, the compiler iterates over the values of the meta-variables and creates a library entry for every valid combination. + +### # Terminology