The special "swifterror" attribute is basically a register pretending to be a pointer in IR, so it needs a mini-mem2reg to implement the liveness and value tracking. Until now this has lived in FunctionLoweringInfo, but it's also usable virtually unchanged for GlobalIsel, provided we can get it out of lib/CodeGen/SelectionDAG.
So this patch extracts those facilities into a separate class that lives under just lib/CodeGen. The bulk of the code is identical, but I made a couple of interface improvements while I was there.
- Removed redundant "SwiftError" name components.
- Simplified the interface for the getOrCreateVReg* functions. The Def function was always used in conjunction with setCurrentVReg so I merged them, allowing the functions to return a simple register rather than a pair.
There should be no functional change, so no tests.