[llvm-dev] [cfe-dev] Understanding Options.td

via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 5 13:20:09 PST 2019

If you're referring to the usual "unused option" warning, that gets
emitted for any option that is not "claimed" meaning that some code
looked to see whether it is present.  For things like -fuse-ld, the
driver only looks for it if it sees that it needs to build a linker
job.  If you troll around the Driver library for OPT_fuse_ld I think
you'll find that only linker-related paths look for it.  There's
nothing special attached to the option that says "linker-only context."

> -----Original Message-----
> From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of David
> Greene via cfe-dev
> Sent: Tuesday, March 05, 2019 4:01 PM
> To: David Blaikie via cfe-dev
> Subject: Re: [cfe-dev] Understanding Options.td
> David Blaikie via cfe-dev <cfe-dev at lists.llvm.org> writes:
> > I haven't looked - but my first guess at an argument to seek
> > inspiration from, would be -fuse-ld. See how that's handled, how it
> > warns if the compiler isn't doing a link action, etc.
> I grepped around but didn't see anything obvious that tells clang to
> emit the warning for use in a non-linking context.  clang does emit the
> warning so I am puzzled about how that happens.
> The definition looks simple enough:
> def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>,
> Flags<[CoreOption]>;
> It must not have anything to do with the TableGen definition.
>                            -David
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

More information about the llvm-dev mailing list