Commit 0e137b2e by Nicolas Capens Committed by Nicolas Capens

Work around Visual Studio template specialization issue.

Visual Studio 2015 generates an error for using array_lengthof() on a template class member array. Since the array content does not depend on the template types, just make it a global. BUG=swiftshader:7 Change-Id: If197308413f880484be06e6738f246be144d0ba6 Reviewed-on: https://chromium-review.googlesource.com/380501Reviewed-by: 's avatarJim Stichnoth <stichnot@chromium.org> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 4d708028
...@@ -415,7 +415,6 @@ protected: ...@@ -415,7 +415,6 @@ protected:
static Type stackSlotType(); static Type stackSlotType();
static constexpr uint32_t NoSizeLimit = 0; static constexpr uint32_t NoSizeLimit = 0;
static const Type TypeForSize[];
/// Returns the largest type which is equal to or larger than Size bytes. The /// Returns the largest type which is equal to or larger than Size bytes. The
/// type is suitable for copying memory i.e. a load and store will be a single /// type is suitable for copying memory i.e. a load and store will be a single
/// instruction (for example x86 will get f64 not i64). /// instruction (for example x86 will get f64 not i64).
......
...@@ -7655,9 +7655,9 @@ Variable *TargetX86Base<TraitsType>::makeReg(Type Type, RegNumT RegNum) { ...@@ -7655,9 +7655,9 @@ Variable *TargetX86Base<TraitsType>::makeReg(Type Type, RegNumT RegNum) {
return Reg; return Reg;
} }
template <typename TraitsType> const Type TypeForSize[] = {IceType_i8, IceType_i16, IceType_i32, IceType_f64,
const Type TargetX86Base<TraitsType>::TypeForSize[] = { IceType_v16i8};
IceType_i8, IceType_i16, IceType_i32, IceType_f64, IceType_v16i8};
template <typename TraitsType> template <typename TraitsType>
Type TargetX86Base<TraitsType>::largestTypeInSize(uint32_t Size, Type TargetX86Base<TraitsType>::largestTypeInSize(uint32_t Size,
uint32_t MaxSize) { uint32_t MaxSize) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment