If the comment about this function is still right (can be called recursively) then the assignment
to irFty should be done after all functions are called.
Takes advantage of move assignment, too.
There might be still some pieces left here and there, and
there is certainly code that could be rewritten in a nicer
way with the 3.0 requirement out of the picture.
This simplifies the code in module.cpp a bit. But it is also the base to implement a pragma to place an arbitrary function in llvm.global_ctors and llvm.global_dtors.