[PATCH] D40518: [CodeView] Re-write TypeSerializer and TypeTableBuilder

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 14:49:29 PST 2017


zturner added inline comments.


================
Comment at: llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h:55
+
+  template <typename RecordType> void writeMemberType(RecordType &Record);
+
----------------
rnk wrote:
> I see how this is supposed to work, but maybe stamping out overloads for all of the member types in the header and redirecting them to use a common template implementation in the .cpp file is a better way to do this.
> 
> Compilers sometimes warn when an implicit template instantiation is requested from a function template declaration with no body.
I had it like you suggested originally, but I actually did this on purpose because it's easier to look at a header file with a single declaration than it is to look at a bunch of template goo and list of 100 method overloads (or alternatively, the macro and `#include` goo that also works).

I explicitly instantiate every template in the implementation file using the macro / `#include` trick, but at least that way it's hidden in the implementation file.  I thought explicit instantiations were correctly supported by all compilers?


https://reviews.llvm.org/D40518





More information about the llvm-commits mailing list