Help to write LLVM MachineFunctionPass

Dear All,

I am writing the MachineFunctionPass passes in LLVM. I am following the steps from following link but not able to proceced further. The steps are not clears since it does mention in which folder we need to store the file and how to compile.

It would be great if some one share sample code of codegen pass(MachineFunctionPass) and steps need to be followed to write LLVM MachineFunctionPass pass, which I wanted run after global register allocation pass.


It may be easiest to copy an existing MachineFunctionPass, chaning file and class names as appropriate.