This is an archive of the discontinued LLVM Phabricator instance.

Use StringRef instead of `const char *`.
ClosedPublic

Authored by ruiu on Jul 6 2018, 3:14 PM.

Details

Summary

I don't think there's a need to use const char *. In most (probably all?)
cases, we need a length of a name later, so discarding a length will
lead to a wasted effort.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Jul 6 2018, 3:14 PM
grimar accepted this revision.Jul 9 2018, 1:34 AM

Looks reasonable, LGTM.

For LLD this seems helps to avoid double find of the name field length:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L2219

This revision is now accepted and ready to land.Jul 9 2018, 1:34 AM
JDevlieghere accepted this revision.Jul 9 2018, 5:00 AM

LGTM, Thanks!

This revision was automatically updated to reflect the committed changes.