Implement mechanism to allow for overwriting of translated functions
Currently, a function that is declared external has to be implemented by the run-time system. However, because the KiCS2 sometimes supports additional features in comparison to the PAKCS (e.g., free integer variables), the Prelude uses conditional compiling leading to different external functions to be implemented by KiCS2 and PAKCS (see prim_plusInt
and plusInt
). In order to unify the libraries for different compilers while enabling support of additional features we want to implement a mechanism that allows for the overwriting of the implementation of translated function. In this case, the KiCS2 should provide an implementation for plusInt
although prim_plusInt
is declared as external. We just have to be careful with inlining, because plusInt
would not be allowed to be inlined for the KiCS2 or otherwise the overwritten implementation would never be used.