changing register classes on a per function basis

Current ISelDagToDag is created once per module.

The TargetLowering class is allocated there and register classes are added and the computeRegisterProperties is called.

In order to switch back and forth between mips16 and mips32, I need to be able to reset what is done during computerRegisterProperties.

Has anyone else looked into this for another port?


Mips16 is an instruction decoding mode, akin to Thumb 1 and so functions of both mips16 and mips32 mode can exist side by side in the same module.



Seems, that except for the obvious memory leaking, that merely resetting AvailableRegClasses and calling computerRegisterProperties again will do the trick.

I'll see if this works and then solve the memory leak problem if it does.

I guess I would add a pair of reset functions to TargetLoweringBase.