This is an archive of the discontinued LLVM Phabricator instance.

Remove unnecessary StringRef convesion in llvm-config
ClosedPublic

Authored by Ericson2314 on Oct 7 2021, 9:13 AM.

Details

Summary

We have a string litteral (via CPP) used to construct StringRef, which
is used to construct a SmallString. Just construct the latter
directly.

Diff Detail

Event Timeline

Ericson2314 requested review of this revision.Oct 7 2021, 9:13 AM
Ericson2314 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2021, 9:13 AM

I think this still ends up doing an implicit conversion to StringRef first since there is no SmallString constructor from const char *. But I guess shorter code is better.

LGTM

This revision was not accepted when it landed; it landed in state Needs Review.Oct 8 2021, 6:16 PM
This revision was automatically updated to reflect the committed changes.