[LLVMdev] a callback for opt plugin unloading event
Jinwook.Shin at microsoft.com
Tue May 21 03:21:16 PDT 2013
Never mind. A global class instance solved the problem (its destructor
takes care of the flushing). But if anyone has a better idea, please let
On 5/20/13 8:46 PM, "Jinwook Shin" <Jinwook.Shin at microsoft.com> wrote:
>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.
More information about the llvm-dev