Added some conversion impls
@@ -39,7 +39,7 @@ macro_rules! enum_value_set {
}
enum_value_set! {AggregateValueEnum: ArrayValue, StructValue}
-enum_value_set! {AnyValueEnum: ArrayValue, IntValue, FloatValue, PhiValue, FunctionValue, PointerValue, StructValue, VectorValue}
+enum_value_set! {AnyValueEnum: ArrayValue, IntValue, FloatValue, PhiValue, FunctionValue, PointerValue, StructValue, VectorValue, InstructionValue}
enum_value_set! {BasicValueEnum: ArrayValue, IntValue, FloatValue, PointerValue, StructValue, VectorValue}
enum_value_set! {BasicMetadataValueEnum: ArrayValue, IntValue, FloatValue, PointerValue, StructValue, VectorValue, MetadataValue}
@@ -156,3 +156,9 @@ impl BasicMetadataValueEnum {
}
}
}
+
+impl From<BasicValueEnum> for AnyValueEnum {
+ fn from(value: BasicValueEnum) -> AnyValueEnum {
+ AnyValueEnum::new(value.as_value_ref())
+ }
+}
