Remove some template instantiations to reduce the number of symbols.
Registry.cpp instantiates all the matchers and it fails to build under MSVC in debug mode.
Details
- Reviewers
klimek
Diff Detail
Event Timeline
This is not the first time we see this.
Maybe someone can decide that /bigobj is required for MSVC in debug mode and we don't have to do this anymore.
MinGW doesn't support anything like /bigobj, so I think we need this or something like it.
http://stackoverflow.com/questions/16596876/object-file-has-too-many-sections
I wonder if putting LLVM_ATTRIBUTE_ALWAYS_INLINE on all IntrusiveRefCntPtr methods would also help reduce the section count.
The always inline macro should be defined pretty on MinGW and pretty much everywhere. It was introduced in gcc 4.0 and we already require gcc 4.7 at a minimum.
BTW, I think the ASTMatchersInternal.h change is a solid compile time win at very low cost. Using always_inline there would still cause us to perform instantiation, so I like this change better.
The unique_ptr change is more questionable, because now the ownership is unmanaged and you would have to implement reset manually in the future. Also consider that the definition of unique_ptr::reset is something like:
void reset(T *New) { T *Tmp = Out; Out = New; delete Tmp; }