[llvm-dev] default value for a newly created clang option

Eli Friedman via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 8 12:26:15 PDT 2016


On Wed, Jun 8, 2016 at 11:26 AM, Rail Shafigulin via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> I've created a new clang option for my target through Options.td. Is there
> a way to give it a default value?
>

Usually cfe-dev is better for questions like this.

clang driver options don't inherently have default values; you just compute
a default value if the flag isn't specified.  There are some helpers to
simplify this; for example, ArgList::hasFlag lets you specify whether the
default is true or false.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160608/49640b84/attachment.html>


More information about the llvm-dev mailing list