blockspacer/CXXCTP

chain source code transformation & generation steps between TU

blockspacer opened this issue · 0 comments

Currently we can apply multiple source code transformation steps within same source file (TU), but can`t chain transformations between TU.

we can chain source code transformation & generation outputs via ->, =>, e.t.c.

~>once - re-run tool on previous + current output files, without adding to list of output files
~>add - re-run tool on previous + current output files, with adding to list of output files
~>re-run - re-run tool on previous output files, without adding to list of output files
~>call(func_name) - call function that will recieve list of starting+previous+current output files and produce new list of output files. func_name must be within same file and registered in Cling as $embed.

struct
  $apply(
    make_public();
    ->;
    typeclass_instance(target = WaterSpell, Spell, MagicItem);
    typeclass_instance(target = WaterSpell, Printable)
    ->;
    make_public();
  )
__tc_Impl3 {
};

First make_public(); will write to one .generated.hpp file
Than -> will get .generated.hpp file name from previous step and re-run clang libtool on it.
Before re-run we must remove

    make_public();
    ->;

to prevent infinite loop.
typeclass_instance will output multiple files.