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.