Hello, 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. Thanks, - JS
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 me know. Thanks, - JS On 5/20/13 8:46 PM, "Jinwook Shin" <Jinwook.Shin at microsoft.com> wrote:>Hello, > >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. > >Thanks, >- JS >
Maybe Matching Threads
- [LLVMdev] Does anaysis group only contain passes?
- Is there something sppecial about pass4 ?
- [LLVMdev] patch: purdy colours for makefiles
- [LLVMdev] running a module pass via opt on multiple bitcode files
- [LLVMdev] running a module pass via opt on multiple bitcode files