I’m having troubles understanding the requirements for machine function passes: http://llvm.org/releases/3.4/docs/WritingAnLLVMPass.html#the-machinefunctionpass-class
It says that they are not allowed to “Maintain state across invocations of runOnMachineFunction (including global data).”
However, doesn’t for example the LiveVariables Pass do exactly that? Besides, how should an analysis pass be of any use if it’s not allowed to build up data structures that persist after the pass has been run?
What I actually want to do is to remember for each function call, which physical registers are live at the time of the call. Therefore I want to fill a map that contains functions as keys and lists of registers as values. Wouldn’t a machine function pass be the natural solution to this?