Prevent vregs leaking into the MC layer via TargetRegisterClass::contains()
authorDaniel Sanders <daniel_l_sanders@apple.com>
Thu, 1 Aug 2019 23:44:42 +0000 (23:44 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Thu, 1 Aug 2019 23:44:42 +0000 (23:44 +0000)
commit1055a11d1bc70f80e78adba816626668941136a4
tree1bbc2c7fa1b56490969b364d90635af2c435cbfe
parentf93d162e335320c5c33f7ae9f6cc94cce2494f6d
Prevent vregs leaking into the MC layer via TargetRegisterClass::contains()

Summary:
The MC layer doesn't expect to deal with vregs but
TargetRegisterClass::contains() forwards into MCRegisterClass::contains()
and this can cause vregs to turn up in the MC layer APIs. Add guards
against this to prevent this becoming a problem as we replace unsigned
with a new MCRegister object for improved type safety.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

Tags: #llvm

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

llvm-svn: 367636
llvm/include/llvm/CodeGen/TargetRegisterInfo.h