[cfe-dev] Lessening the driver's reliance on default target triples

Vedant Kumar via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 12 16:55:51 PDT 2016


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?

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