[ORC] Compile On Demand and static constructors

Hi everyone, hi Lang.

I am using ORC’s CoD layer to run some code.
However, I am having problems with understanding how to call static constructors properly.
Previously, when I did not use CoD, I run all constructors for each module before running ‘main’.
Now I see that some constructors may be not needed at all.
The question is: how do I decide which constructor to run and at which point?
I use LLVM 3.9, in case it matters.

I would appreciate any hints and recommendations.

Thank you.