Page MenuHomePhabricator

[MC] Assert that MCRegUnitIterator operates over MCRegisters
ClosedPublic

Authored by mtrofin on Oct 1 2020, 2:42 PM.

Details

Summary

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.

Diff Detail

Event Timeline

mtrofin created this revision.Oct 1 2020, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2020, 2:42 PM
mtrofin requested review of this revision.Oct 1 2020, 2:42 PM
mtrofin added a reviewer: wmi.Oct 2 2020, 7:59 AM
gjain accepted this revision.Oct 2 2020, 10:52 AM
This revision is now accepted and ready to land.Oct 2 2020, 10:52 AM