Michael McCracken
2005-Apr-18 22:04 UTC
[LLVMdev] Best way to require a pass from a dynamically loaded module?
Hi, I have a situation where I built an analysis pass as a loadable module, but I'd like to require it from other passes, to make it available if it's been loaded. Is there a clean way to do this, or am I stretching it too far? If there isn't a nice way, I'd be interested in discussion about what would be the least ugly hack just to get it working. Thanks! -mike -- Michael McCracken UCSD CSE PhD Student San Diego Supercomputer Center http://www.cse.ucsd.edu/~mmccrack/
Chris Lattner
2005-Apr-19 16:46 UTC
[LLVMdev] Best way to require a pass from a dynamically loaded module?
On Mon, 18 Apr 2005, Michael McCracken wrote:> Hi, I have a situation where I built an analysis pass as a loadable > module, but I'd like to require it from other passes, to make it > available if it's been loaded.Does this mean that the "other passes" are not part of the loadable module?> Is there a clean way to do this, or am I stretching it too far? > If there isn't a nice way, I'd be interested in discussion about what > would be the least ugly hack just to get it working.One thing you could use/abuse is the AnalysisGroup mechanism. You could define an analysis group MyAG, with a default (empty) implementation. The loadable module could implement another implementation of MyAG. Other passes could use MyAG without knowing whether they are getting the default ("empty") implementation or the loaded one. Analysis groups are how the AliasAnalysis itf works for example. The HowToWriteAPass guide should explain how it works, -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
Reasonably Related Threads
- [LLVMdev] problem loading analysis results from Inliner pass
- [LLVMdev] problem loading analysis results from Inliner pass
- [LLVMdev] problem loading analysis results from Inliner pass
- [LLVMdev] problem loading analysis results from Inliner pass
- [LLVMdev] lli: problem finding external symbol