[PATCH] D53424: Enable thread specific cl::opt values for multi-threaded support

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 21 14:04:32 PDT 2018


MatzeB added a comment.

Can you explain what you would use per-thread command line options for?
Intuitively I would not expect actual commandline users wanting to set options per thread. If you need it to tweak compiler behavior then it might be better to find ways to encode the information in `TargetOptions.h`, function attributes or similar, so we have a streamlined way of setting them independently of programmatically modifying commandline options.

I also think we agree that ideally cl::opts would be part of the LLVMContext. I just suspect inertia to actually do this is somewhat slow as it naturally means making the use of options being more typing than before... Apart it is a little known fact, but we do even have API for options in LLVMContext: https://reviews.llvm.org/D5389 / https://reviews.llvm.org/rL219854 define it and use it for a single option. Unfortunately this was never followed up by transitioning additional options.


Repository:
  rL LLVM

https://reviews.llvm.org/D53424





More information about the llvm-commits mailing list