[LLVMdev] request for tutorial
renato.golin at linaro.org
Thu Sep 26 02:14:04 PDT 2013
On 26 September 2013 10:03, David Chisnall <David.Chisnall at cl.cam.ac.uk>wrote:
> Another example is object::ObjectFile. You can cast<> or dyn_cast<> these
> down to object::COFFObjectFiles or object::MachOObjectFiles easily, but
> object::ELFObjectFile is a template class and there's no documentation of
> what the template parameter should be, of it if's possible to infer it from
> the object::ObjectFile somehow.
This strikes me as poor design, helped by the fact that there was no
expected API or documentation on how to use it, so special implementations
will differ and become incompatible with each other. Per se, it's not a
problem, but when you change the interface, (or when trying to use
polymorphism), things can go wrong in mysterious ways.
A few lines of comments saying what's expected from the derived classes
would have prompted folks to work around the template problems (or found a
different solution) before it became an issue.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev