This is an archive of the discontinued LLVM Phabricator instance.

[tablegen] Avoid creating temporary strings
ClosedPublic

Authored by alexander-shaposhnikov on Jul 4 2017, 7:32 PM.

Details

Summary

If a method / function returns a StringRef but the
variable is of type const std::string& a temporary string is
created (StringRef has a cast operator to std::string),
which is a suboptimal behavior.

Test plan: make check-all

This cleanup is a continuation of the efforts started
in https://reviews.llvm.org/D34969 and https://reviews.llvm.org/D34970.
The changes are broken up into multiples diffs
to make reviewing / landing / reverting (if necessary) easier.

Test plan: make check-all

Diff Detail

Repository
rL LLVM

Event Timeline

alexander-shaposhnikov retitled this revision from [table] Avoid creating temporary strings to [tablegen] Avoid creating temporary strings.
dblaikie accepted this revision.Jul 4 2017, 7:59 PM

Looks good - thanks!

This revision is now accepted and ready to land.Jul 4 2017, 7:59 PM
This revision was automatically updated to reflect the committed changes.