(original) (raw)

Hello Matthias.

The idea of having a separate API for options in LLVMContext is good but difficult to implement. That is probably why it has not been evolved.
There are so many cl::opt all over the code to change ... This would also split all cl::opt into incompatible groups: those that are bound to LLVMContext and those that are not.
With the proposed thread local option context (https://reviews.llvm.org/D53424) your idea can be simulated by binding LLVMContexts with ContextValues and setting threads to their LLVMContexts' ContextValues.
I believe that D53424 is a minimal change that can greatly extend the cl::opt-based configuration flexibility without affecting other aspects. This change does not contradict with module flags, LLVMContext Debug options and other ways we have to customize the pipeline.

Thanks.
-Yevgeny Rouban