Closed rdaly525 closed 7 years ago
The way that LLVM does this is they have all the 'Uses' of a function within a LLVM::Module, and you have a command that just says replace all instances with this other instance.
I could do the same thing for CoreIR where I basically keep pointers to all instances (within a namespace) which use a specific Module. Then add a function from module that says replace all instnaces of this module with other module.
Should have a function like:
Instantiable replaceAllUsesWith(Instantiable)
This was already put in
This should be a framework for iterating over all instances in the design and performing some set of actions on the instance.
An initial step would basically implement 1 to 1 replacement. A second step would be able to swap out multiple things.