[LLVMdev] a callback for opt plugin unloading event

Jinwook Shin Jinwook.Shin at microsoft.com
Mon May 20 20:46:42 PDT 2013


My opt plugin contains multiple passes in it and each pass produces some results and saves them in a global data structure. 

$ opt -load myplugin.dylib -pass1 -pass2 -pass3 test.bc

After all passes finish running, I need to flush out the collected results to a disk file. But I don't know when I can do it. Is there a way/callback for my plugin to know when opt is done with it? 

Perhaps the last pass could take care of the flushing but my understanding is that it's up to PassManager that decides which pass to run lastly, so I don't think this heck would be a good idea, especially given that I keep adding new passes to my plugin.

- JS

More information about the llvm-dev mailing list