AST: inline the definition for AnyValue::Holder<Type>::equals

Unfortunately, MSVC will not preserve the template specialization in
swiftAST.  However, the function is pretty tiny, so simply inline it
into the header.  This allows the template specialization to be
instantiated and inlined at the use site.  The overall size impact
should be negligible and this repairs the Windows build.
This commit is contained in:
Saleem Abdulrasool
2019-04-25 08:58:54 -07:00
parent 155a155000
commit c38f6ab8b4
2 changed files with 5 additions and 9 deletions

View File

@@ -550,7 +550,11 @@ public:
// Allow AnyValue to compare two Type values, even though Type doesn't
// support ==.
template<>
bool AnyValue::Holder<Type>::equals(const HolderBase &other) const;
inline bool AnyValue::Holder<Type>::equals(const HolderBase &other) const {
assert(typeID == other.typeID && "Caller should match type IDs");
return value.getPointer() ==
static_cast<const Holder<Type> &>(other).value.getPointer();
}
void simple_display(llvm::raw_ostream &out, const Type &type);