[all-commits] [llvm/llvm-project] aedb66: [MachineVerifier] Use the for_range loop to instea...

Zhang Kang via All-commits all-commits at lists.llvm.org
Thu May 14 19:36:18 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: aedb6615a8d08d7dfeba17bf22ff4c6fd104cadc
      https://github.com/llvm/llvm-project/commit/aedb6615a8d08d7dfeba17bf22ff4c6fd104cadc
  Author: Kang Zhang <shkzhang at cn.ibm.com>
  Date:   2020-05-15 (Fri, 15 May 2020)

  Changed paths:
    M llvm/lib/CodeGen/MachineVerifier.cpp

  Log Message:
  -----------
  [MachineVerifier] Use the for_range loop to instead llvm::any_of

Summary:
In the patch D78849, it uses llvm::any_of to instead of for loop to
simplify the function addRequired().
It's obvious that above code is not a NFC conversion. Because any_of
will return if any addRequired(Reg) is true immediately, but we want
every element to call addRequired(Reg).

This patch uses for_range loop to fix above any_of bug.

Reviewed By: MaskRay, nickdesaulniers

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




More information about the All-commits mailing list