Replacing all uses of a StructType


I’m trying to replace all uses of StructType A with StructType B. I’ve created a class that inherits from ValueMapTypeRemapper, returns B whenever A is passed to it, and used this class with the CloneFunctionInto function.

Is there a way to clone a function into itself? Currently I’ve got duplicates of most of my functions, which is fine, but I don’t need to duplicate main, so I’m looking for a way to replace all uses of A with B inside main.


You can clone main() into a new function, the rename main() to something else (e.g., oldmain()), and then rename your new function main(). In fact, I think Value * now has a takeName() method that allows you to do the renaming with a single method call. Regards, John Criswell