void EmitWriteValueType(ILGenerator il, LocalBuilder writer, Type valType)
{
Debug.Assert(valType.IsValueType);
Debug.Assert(!(valType.IsEnum || valType.IsPrimitive));
var fieldVal = il.DeclareLocal(valType);
il.Emit(OpCodes.Stloc, fieldVal);
foreach (FieldInfo field in GetSerializableFields(valType)) {
EmitWriteField(il, writer, fieldVal, field);
}
}
#endregion