Skip to content

Commit

Permalink
Values and types can now be copied and cloned.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregoire Geis committed Sep 29, 2017
1 parent c9a751b commit 4a569a4
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/types/array_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use types::traits::AsTypeRef;
use types::{Type, BasicType, PointerType, FunctionType};
use values::{BasicValue, ArrayValue, PointerValue, IntValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct ArrayType {
array_type: Type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/float_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use types::traits::AsTypeRef;
use types::{Type, PointerType, FunctionType, BasicType, ArrayType, VectorType};
use values::{FloatValue, GenericValue, PointerValue, IntValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct FloatType {
float_type: Type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/fn_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use types::traits::AsTypeRef;
use types::{Type, BasicTypeEnum};
// use values::FunctionValue;

#[derive(PartialEq, Eq)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub struct FunctionType {
fn_type: Type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/int_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use types::traits::AsTypeRef;
use types::{Type, ArrayType, BasicType, VectorType, PointerType, FunctionType};
use values::{GenericValue, IntValue, PointerValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct IntType {
int_type: Type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use values::{IntValue, PointerValue};
// Worth noting that types seem to be singletons. At the very least, primitives are.
// Though this is likely only true per thread since LLVM claims to not be very thread-safe.
// REVIEW: Maybe move this into its own module?
#[derive(PartialEq, Eq)]
#[derive(PartialEq, Eq, Clone, Copy)]
struct Type {
type_: LLVMTypeRef,
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/ptr_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use types::traits::AsTypeRef;
use types::{Type, BasicType, ArrayType, FunctionType, VectorType};
use values::{PointerValue, IntValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct PointerType {
ptr_type: Type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/struct_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use types::traits::AsTypeRef;
use types::{Type, BasicType, BasicTypeEnum, ArrayType, PointerType, FunctionType, VectorType};
use values::{BasicValue, StructValue, PointerValue, IntValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct StructType {
struct_type: Type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/vec_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use values::{BasicValue, PointerValue, VectorValue, IntValue};

// REVIEW: vec_type() is impl for IntType & FloatType. Need to
// find out if it is valid for other types too. Maybe PointerType?
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct VectorType {
vec_type: Type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/void_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use values::PointerValue;

use std::ffi::CStr;

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct VoidType {
void_type: Type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/array_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use types::ArrayType;
use values::traits::AsValueRef;
use values::{Value, InstructionValue, MetadataValue};

#[derive(PartialEq, Eq)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub struct ArrayValue {
array_value: Value
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/float_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use types::{AsTypeRef, FloatType, IntType};
use values::traits::AsValueRef;
use values::{InstructionValue, IntValue, Value, MetadataValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct FloatValue {
float_value: Value
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/fn_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use types::{BasicTypeEnum, FunctionType};
use values::traits::AsValueRef;
use values::{BasicValueEnum, Value, MetadataValue};

#[derive(PartialEq, Eq)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub struct FunctionValue {
fn_value: Value,
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/int_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use types::{AsTypeRef, FloatType, PointerType, IntType};
use values::traits::AsValueRef;
use values::{FloatValue, InstructionValue, PointerValue, Value, MetadataValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct IntValue {
int_value: Value,
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/metadata_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::slice::from_raw_parts;

pub const FIRST_CUSTOM_METADATA_KIND_ID: u32 = 14; // TODO: Varies by version

#[derive(PartialEq, Eq)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub struct MetadataValue {
metadata_value: Value,
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use llvm_sys::prelude::{LLVMValueRef, LLVMTypeRef};
use std::ffi::{CString, CStr};
use std::fmt;

#[derive(PartialEq, Eq)]
#[derive(PartialEq, Eq, Clone, Copy)]
struct Value {
value: LLVMValueRef,
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/phi_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use values::traits::AsValueRef;
use values::{BasicValue, BasicValueEnum, InstructionValue, Value};

// REVIEW: Metadata for phi values?
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct PhiValue {
phi_value: Value
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/ptr_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::ffi::CStr;
use types::{AsTypeRef, IntType, PointerType};
use values::{AsValueRef, InstructionValue, IntValue, Value, MetadataValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct PointerValue {
ptr_value: Value,
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/struct_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use types::StructType;
use values::traits::AsValueRef;
use values::{InstructionValue, Value, MetadataValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct StructValue {
struct_value: Value
}
Expand Down
2 changes: 1 addition & 1 deletion src/values/vec_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use types::{VectorType};
use values::traits::AsValueRef;
use values::{BasicValueEnum, BasicValue, InstructionValue, Value, IntValue, MetadataValue};

#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct VectorValue {
vec_value: Value,
}
Expand Down

0 comments on commit 4a569a4

Please sign in to comment.