Add and dsecribe args gen(s)_num to MIR generator functions.
@@ -606,17 +606,23 @@ main: func
works only on the same targets as MIR generator
# MIR generator (file mir-gen.h)
- * Before use of MIR generator for given context you should initialize it by API function `MIR_gen_init (MIR_context ctx)`
- * API function `MIR_gen_finish (MIR_context ctx)` frees all internal generator data for the context.
- If you want to generate code for the context again after the `MIR_gen_finish` call, you should call `MIR_gen_init` again first
- * API function `void *MIR_gen (MIR_context ctx, MIR_item_t func_item)` generates machine code of given MIR function
- and returns an address to call it. You can call the code as usual C function by using this address
- as the called function address
- * API function `void MIR_gen_set_debug_file (MIR_context_t ctx, FILE *f)` sets up MIR generator debug file to `f`.
+ * Before use of MIR generator for given context you should initialize it by API function
+ `MIR_gen_init (MIR_context ctx, int gens_num)`. `gens_num` defines how many generator instances you need.
+ Each generator instance can be used in a different thread to compile different MIR functions from the same context.
+ If you pass a negative or zero number `gens_num`, it will have the same effect as value `1`
+ * API function `MIR_gen_finish (MIR_context ctx)` frees all internal generator data (and its instances) for the context.
+ If you want to generate code for the context again after the `MIR_gen_finish` call, you should call
+ `MIR_gen_init` again first
+ * API function `void *MIR_gen (MIR_context ctx, int gen_num, MIR_item_t func_item)` generates machine code
+ of given MIR function in generator instance `gen_num` and returns an address to call it. You can call
+ the code as usual C function by using this address as the called function address.
+ `gen_num` should be a number in the range `0` .. `gens_num - 1` from corresponding `MIR_gen_init`
+ * API function `void MIR_gen_set_debug_file (MIR_context_t ctx, int gen_num, FILE *f)` sets up MIR generator
+ debug file to `f` for generator instance `gen_num`.
If it is not NULL a lot of debugging and optimization information will be output to the file. It is useful mostly
for MIR developers
- * API function `void MIR_gen_set_optimize_level (MIR_context_t ctx, unsigned int level)` sets up optimization
- level for MIR generator:
+ * API function `void MIR_gen_set_optimize_level (MIR_context_t ctx, int gen_num, unsigned int level)` sets up optimization
+ level for MIR generator instance `gen_num`:
* `0` means only register allocator and machine code generator work
* `1` means additional code selection task. On this level MIR generator creates more compact and faster
code than on zero level with practically on the same speed
