<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Chandler brought up a lot of really great points. One of his big points was that if we’re going to touch every pass, we may as well fix the cl::opt API too.<div class=""><br class=""></div><div class="">Toward that end I’ve put together some patches with a new fluent-style API as a starting point of a conversation.</div><div class=""><br class=""></div><div class="">Disclaimer: To make these patches work with the existing cl::opts there is some nasty hackery going on in CommandLine.h — For the sake of this conversation I’d like to focus our attention on the API for creating and accessing options in Scalarizer.cpp</div><div class=""><br class=""></div><div class="">My intent with these changes is to provide a groundwork for meeting all of Chandler’s main points. These patches have the following high-level changes from my previous patches:</div><div class=""><br class=""></div><div class="">1) I’ve switched to some crazy template-foo for generating IDs to identify options</div><div class="">2) I’ve moved all the new API components out of the cl namespace</div><div class="">3) There is no option storage outside the OptionRegistry, but I have defined a get API and setup template methods for reading from a store and suggested API for LLVMContext to implement</div><div class="">4) I’ve defined a new API for defining options in the form of the opt_builder object. This is intended to be a transitional API only, but it allows us to migrate off the cl::opt template-foo</div><div class=""><br class=""></div><div class="">As with my previous patches, these patches are designed to work with existing cl::opts.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">-Chris</div><div class=""></div></body></html>