[all-commits] [llvm/llvm-project] 0a3523: [MC] Assert that MCRegUnitIterator operates over M...

Mircea Trofin via All-commits all-commits at lists.llvm.org
Sat Oct 3 13:18:49 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0a3523299dec61f2e6eb2a28fdecd25360e8b6d8
      https://github.com/llvm/llvm-project/commit/0a3523299dec61f2e6eb2a28fdecd25360e8b6d8
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2020-10-03 (Sat, 03 Oct 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/Register.h
    M llvm/include/llvm/MC/MCRegister.h
    M llvm/include/llvm/MC/MCRegisterInfo.h

  Log Message:
  -----------
  [MC] Assert that MCRegUnitIterator operates over MCRegisters

The signature of the ctor expects a MCRegister, but currently any
unsigned value can be converted to a MCRegister.

This patch checks that indeed the provided value is a physical register
only. We want to eventually stop implicitly converting unsigned or
Register to MCRegister (which is incorrect). The next step after this
patch is changing uses of MCRegUnitIterator to explicitly cast Register
or unsigned values to MCRegister. To that end, this patch also
introduces 2 APIs that make that conversion checked and explicit.

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




More information about the All-commits mailing list