[lld] r287938 - [ELF] Add explicit template instantiations for toString

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 18:27:14 PST 2016


David Blaikie via llvm-commits <llvm-commits at lists.llvm.org> writes:

> This seems a bit esoteric/unusual compared to the norm for C++ in general
> and the LLVM project in particular. Also requires maintenance of those
> explicit instantiation lists, producing the kinds of problems you fixed
> here.
>
> Perhaps it could just roll the definitions into the header instead? (if the
> separation is particularly important - the template definitions can be kept
> in a separate section of the header from the declarations - but this isn't
> done all that often either, in my experience)

Lets please keep them in the .cpp file. These templates are only ever
instantiated with 4 types and putting them in a .cpp helps with build
type.

Cheers,
Rafael


More information about the llvm-commits mailing list