<div>Cedric,</div>
<div> </div>
<div>Thanks for the reply.</div>
<div> </div>
<div>I'm afraid I'm a bit template-dumb and don't know how to do those declarations. Every syntax combination I tried either didn't compile there, or elsewhere, the latter because the exported declarations would conflict with the "static node *Head, *Tail;" and "static listener *ListenerHead, *ListenerTail;" definitions inside the Registry template class. Can you give me an example?</div>
<div> </div>
<div>Template trickiness like this is why I felt a less sophisticated plug-in registry mechanism would be better. But if you can show me how to do it per your suggestion, I'll give it a try.</div>
<div> </div>
<div>-John<br><br></div>
<div class="gmail_quote">On Tue, May 10, 2011 at 5:17 AM, Cédric Venet <span dir="ltr"><<a href="mailto:cedric.venet@laposte.net">cedric.venet@laposte.net</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>Hi,
<div class="im"><br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">1. Plug-in registration. The current plug-in mechanism doesn't work on Windows. Shared libraries work differently on Windows, such that building a plug-in DLL on windows doesn't create a connection to the plug-in registry in the libraries used in the Clang executable. The result is that in running a plug-in like the PrintFunctionNames plug-in, there is no output becase the plug-in is adding an entry to a registry that exists only in it's own data space.<br>
My solution for this was to dumb-down the registry a bit, and to have the plug-in export a function to be called that creates and returns the plug-in action object.<br></blockquote><br></div>"fixing" the current implementation for dll is not to hard (I think) but need a little work. On would need to remove the following lines from the end of llvm/include/llvm/Support/Registry.h<br>
<br>==========<br> // Since these are defined in a header file, plugins must be sure to export<br> // these symbols.<br><br> template <typename T, typename U><br> typename Registry<T,U>::node *Registry<T,U>::Head;<br>
<br> template <typename T, typename U><br> typename Registry<T,U>::node *Registry<T,U>::Tail;<br><br> template <typename T, typename U><br> typename Registry<T,U>::listener *Registry<T,U>::ListenerHead;<br>
<br> template <typename T, typename U><br> typename Registry<T,U>::listener *Registry<T,U>::ListenerTail;<br>==========<br><br>and instead to instanciate them in a cpp file (or multiple file) for each combination of T and U used. Those files would be part of the big DLL.<br>
I don't know how many registry exist in llvm, but probably not that much. Also, adding a registry is a rare occurence. greping the files for Registry should show the needed instanciation.<br><br>Regards,<br><font color="#888888">Cédric<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br>