[llvm-dev] 'cl::opt' and range checking

ORiordan, Martin via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 3 06:24:09 PDT 2017


Hi LLVM-Devs,

The LLVM 'cl::opt' templates are really useful, and provide a lot of flexibility.  But I don't see any support for ranged options.  What I would like is to have an option which is an integer type, and to restrict the set of values provided to a simple upper and lower bound, for example between 10 and 2000.

Is there a way of expressing this with the 'cl::opt' templates, or do I have to explicitly range check the values in my own code and issue a diagnostic or clamp as appropriate?

Thanks,

            MartinO

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171003/ec4396fe/attachment.html>


More information about the llvm-dev mailing list