@Nonnull
	static ReValue ofConstant(@Nullable Object value) throws IllegalValueException {
		return switch (value) {
			case Integer i -> IntValue.of(i);
			case Float f -> FloatValue.of(f);
			case Long l -> LongValue.of(l);
			case Double d -> DoubleValue.of(d);
			case String s -> ObjectValue.string(s);
			case Handle handle -> ObjectValue.VAL_METHOD_HANDLE;
			case Type type -> {
				int sort = type.getSort();
				if (sort == Type.OBJECT || sort == Type.ARRAY)
					yield ObjectValue.VAL_CLASS;
				if (sort == Type.METHOD)
					yield ObjectValue.VAL_METHOD_TYPE;
				throw new IllegalValueException("Illegal LDC value " + value);
			}
			case ConstantDynamic constantDynamic -> {
				Type dynamicType = Type.getType(constantDynamic.getDescriptor());
				ReValue dynamicValue = ofType(dynamicType, Nullness.NOT_NULL);
				if (dynamicValue == null)
					throw new IllegalValueException("Illegal LDC dynamic value descriptor " + dynamicType);
				yield dynamicValue;
			}
			case null, default -> throw new IllegalValueException("Illegal LDC value " + value);
		};
	}
@param value
		ASM constant value in a LDC instruction.

@return A {@link ReValue} wrapper of the given input.

@throws IllegalValueException
		When the value could not be mapped to a {@link ReValue}.
@see LdcInsnNode#cst Possible values
recaf-core/src/main/java/software/coley/recaf/util/analysis/value/ReValue.java