[all-commits] [llvm/llvm-project] b3f547: [ValueLattice] Add move constructor (NFC)

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Apr 20 09:35:34 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b3f5472c2b9c8cf99239a9ac655555e9f0ba9e5d
      https://github.com/llvm/llvm-project/commit/b3f5472c2b9c8cf99239a9ac655555e9f0ba9e5d
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-04-20 (Mon, 20 Apr 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/ValueLattice.h

  Log Message:
  -----------
  [ValueLattice] Add move constructor (NFC)

Following the rule of five, declare move constructor and move
assignment operator for ValueLatticeElement. This allows moving
the ConstantRange rather than copying it.

This does not matter in most cases, where we're dealing with
APInts <= 64 bits. It does avoid unnecessary copies of allocations
for larger APInts.

Additionally we change the implementation approach to make the
copy/move assignment operators make use of the copy/move constructors,
rather than the other way around. The constructors are the more
primitive operations.

Differential Revision: https://reviews.llvm.org/D78425




More information about the All-commits mailing list