Page MenuHomePhabricator

[TableGen][GlobalISel] Rework RegisterBankEmitter for easier const correctness

Authored by lewis-revill on Mar 11 2020, 10:12 AM.



This patch rewrites the RegisterBankEmitter class to derive RegisterClassHierarchy from CodeGenTarget::getRegBank() rather than constructing our own copy. All are now accessed through a const reference.

This appeared to fix a case of invalidating vectors within RegisterClassHierarchy.getHwModes() - found when testing implementations for another RegisterBankEmitter patch.

Diff Detail