This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][NFC] when reasonable, replace auto keyword with type names
ClosedPublic

Authored by gkm on Mar 9 2021, 8:32 PM.

Details

Summary

lld policy discourages auto. Replace it with a type name whenever reasonable. Retain auto to avoid ...

  • redundancy, as for decls such as auto *t = mumble_cast<TYPE *> or similar that specifies the result type on the RHS
  • verbosity, as for iterators
  • gratuitous suffering, as for lambdas

Along the way, add const when appropriate.

Note: a future diff will ...

  • add more const qualifiers
  • remove opt:: when we are already using llvm::opt

Diff Detail

Event Timeline

gkm created this revision.Mar 9 2021, 8:32 PM
Herald added a project: Restricted Project. · View Herald Transcript
gkm requested review of this revision.Mar 9 2021, 8:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2021, 8:32 PM
int3 accepted this revision.Mar 9 2021, 9:12 PM

Thanks!

This revision is now accepted and ready to land.Mar 9 2021, 9:12 PM
This revision was landed with ongoing or failed builds.Mar 9 2021, 10:13 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Mar 10 2021, 5:55 AM

Thank you for this change!