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/380501
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
Tested-by: Nicolas Capens <nicolascapens@google.com>
static Type stackSlotType();
static constexpr uint32_t NoSizeLimit = 0;
- static const Type TypeForSize[];
/// 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
/// instruction (for example x86 will get f64 not i64).
return Reg;
}
-template <typename TraitsType>
-const Type TargetX86Base<TraitsType>::TypeForSize[] = {
- IceType_i8, IceType_i16, IceType_i32, IceType_f64, IceType_v16i8};
+const Type TypeForSize[] = {IceType_i8, IceType_i16, IceType_i32, IceType_f64,
+ IceType_v16i8};
+
template <typename TraitsType>
Type TargetX86Base<TraitsType>::largestTypeInSize(uint32_t Size,
uint32_t MaxSize) {