This is an archive of the discontinued LLVM Phabricator instance.

Retry: [Driver] Compute effective target triples once per job (NFCI)
ClosedPublic

Authored by vsk on Jul 20 2016, 2:47 PM.

Details

Summary

Compute an effective triple once per job. Cache the triple in the
prevailing ToolChain for the duration of the job.

Clients which need effective triples now look them up in the ToolChain.
This eliminates wasteful re-computation of effective triples (e.g in
getARMFloatABI()).

While we're at it, delete MachO::ComputeEffectiveClangTriple. It was a
no-op override.


Note: This commit is based on ToT clang with the original attempt
(r275895) reverted. See the list thread on r275895 for more context.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk updated this revision to Diff 64769.Jul 20 2016, 2:47 PM
vsk retitled this revision from to Retry: [Driver] Compute effective target triples once per job (NFCI).
vsk updated this object.
vsk added reviewers: echristo, dexonsmith.
vsk added a subscriber: cfe-commits.
mehdi_amini added inline comments.Jul 20 2016, 3:16 PM
include/clang/Driver/ToolChain.h
71 ↗(On Diff #64769)

Documentation would be appreciated, a mutable field is never trivial to me.

145 ↗(On Diff #64769)

No brief.

vsk updated this revision to Diff 64792.Jul 20 2016, 4:12 PM
  • Address Mehdi's comments (drop \brief, document a field).
  • Make ToolChain::setEffectiveTriple() private.
vsk marked 2 inline comments as done.Jul 20 2016, 4:13 PM
echristo accepted this revision.Jul 27 2016, 2:42 PM
echristo edited edge metadata.

Not a huge fan of the registration/etc. That said, this is cleaner than a lot of the alternatives at the moment without making you do a lot of toolchain evisceration.

LGTM.

-eric

This revision is now accepted and ready to land.Jul 27 2016, 2:42 PM
This revision was automatically updated to reflect the committed changes.