[cfe-dev] Lessening the driver's reliance on default target triples
Duncan P. N. Exon Smith via cfe-dev
cfe-dev at lists.llvm.org
Wed Jul 13 18:56:40 PDT 2016
> On 2016-Jul-12, at 16:55, Vedant Kumar <vsk at apple.com> wrote:
>
> Hi cfe-dev,
>
> The clang driver uses "default" and "effective" target triples in a rather ad
> hoc way. Cleaning this up would have a few benefits:
>
> - Better error reporting. We have a few open bugs about error messages
> derived from default target triples, instead of more specific ones.
>
> - Less waste. Effective triples are needlessly recomputed in several
> different parts of the driver. This just needs to happen once per job.
>
> - Less confusion about which kind of triple to use in a given context. It
> should basically always be easy to use an effective triple.
>
> We can't do away with default triples entirely. They appear to be needed to get
> ToolChains. Once a ToolChain is available, we can get effective triples.
>
> My plan is to remove uses of default triples in the driver until they are
> *only* needed to compute effective triples. I don't know if this goal is
> realistic, but I still expect incremental progress towards it to be beneficial.
>
> What do people think of this plan?
I forgot to respond to the RFC. This makes sense to me -- making the effective triple canonical improves error messages and factors away a class of bugs.
>
> best,
> vedant
>
> p.s:
>
> To make this a bit more concrete, here are some initial patches:
>
> http://reviews.llvm.org/D22289 [Driver] Make Driver::DefaultTargetTriple private (NFCI)
> http://reviews.llvm.org/D22290 [Driver] Compute effective target triples once per job (NFCI)
More information about the cfe-dev
mailing list