Example #1
0
 /// <summary>
 /// Tries to map the given IR value representing a raw integer-based value size
 /// to a corresponding <see cref="BasicValueType"/> entry.
 /// </summary>
 /// <param name="value">The IR to map.</param>
 /// <param name="valueType">The determined basic-value type (if any).</param>
 /// <returns>
 /// True, if the given IR node could be mapped to a basic value type.
 /// </returns>
 private static bool TryGetBasicValueSize(
     Value value,
     out BasicValueType valueType)
 {
     valueType =
         value is PrimitiveValue size &&
         size.BasicValueType.IsInt()
         ? PrimitiveType.GetBasicValueTypeBySize(size.Int32Value)
         : BasicValueType.None;
     return(valueType != BasicValueType.None);
 }