This is an archive of the discontinued LLVM Phabricator instance.

Remove unneccessary string copies from method invocations.
ClosedPublic

Authored by hctim on Sep 8 2017, 4:28 PM.

Details

Summary

Change string parameter 'File' to be passed by const-reference to
reduce copies.

Diff Detail

Repository
rL LLVM

Event Timeline

hctim created this revision.Sep 8 2017, 4:28 PM
vlad.tsyrklevich accepted this revision.Sep 8 2017, 4:51 PM

Do you need me to commit on your behalf?

This revision is now accepted and ready to land.Sep 8 2017, 4:51 PM

Will be good idea to also run Clang-tidy modernize-* over this code.

tools/llvm-objdump/llvm-objdump.cpp
432 ↗(On Diff #114462)

Please use = default and move it after constructors.

433 ↗(On Diff #114462)

Please use default member initialization and = default;

hctim updated this revision to Diff 114697.Sep 11 2017, 2:16 PM
hctim marked 2 inline comments as done.

Added = default for trivial constructors/destructors.

hctim updated this revision to Diff 114721.EditedSep 11 2017, 3:37 PM

Made a mistake in last diff, SourcePrinter() is now correctly default-member initialised (note that the unique_ptr is already nullptr-initialised on construction).

This revision was automatically updated to reflect the committed changes.