[PATCH] D54885: Assigning to a local object in a return statement prevents copy elision. NFC.

Arthur O'Dwyer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 09:32:20 PST 2018


Quuxplusone updated this revision to Diff 175508.
Quuxplusone added a subscriber: steveire.
Quuxplusone added a comment.

Extend my check to include `return ++x`, which catches a couple more cases. These are iterator types, which means they are presumably "cheap" to copy; but they aren't trivial, unless my checker has a bug. :)

@steveire suggests that I should try turning my checker into a clang-tidy matcher.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54885/new/

https://reviews.llvm.org/D54885

Files:
  include/llvm/CodeGen/MachineInstrBundle.h
  include/llvm/Support/BranchProbability.h
  lib/Support/Path.cpp
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/X86/X86MCInstLower.cpp
  lib/Transforms/Instrumentation/Instrumentation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54885.175508.patch
Type: text/x-patch
Size: 3617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181127/027ab819/attachment.bin>


More information about the llvm-commits mailing list