This is an archive of the discontinued LLVM Phabricator instance.

Support: Remove needless allocation when getMainExecutable() calls readlink()
ClosedPublic

Authored by thakis on Aug 7 2019, 9:36 AM.

Details

Summary

We built a StringRef from a string literal which we then converted to a
std::string to call c_str(). Just use a pointer to the string literal
instead of a StringRef.

No behavior change.

Diff Detail

Repository
rL LLVM

Event Timeline

thakis created this revision.Aug 7 2019, 9:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2019, 9:36 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
rnk accepted this revision.Aug 7 2019, 9:49 AM

lgtm

Huh, code seems to date from 2012: rL164676.

This revision is now accepted and ready to land.Aug 7 2019, 9:49 AM
This revision was automatically updated to reflect the committed changes.