There some cases where I will need to emit some stubs and I only find out about this while I'm compiling a function.
Typically a function pass cannot create new functions; only a module pass can do that.
What would be the correct way to do this?
TIA.
Reed
There some cases where I will need to emit some stubs and I only find out about this while I'm compiling a function.
Typically a function pass cannot create new functions; only a module pass can do that.
What would be the correct way to do this?
There may be several ways to do it, but I think the most typical approach is to run a ModulePass before all of your FunctionPass's that adds any functions that may be required. If the set of all possible functions is known apriori, this should work. Dead Code Elimination can delete any functions that are unused at the end.
Another approach is to make all of your code ModulePass's. This may be less ideal, but you can probably get it to work.
-- John T.