Skip to content

Commit

Permalink
capitalized C in creates and fixed spacing after the slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
OranGot committed Sep 20, 2024
1 parent e99657c commit 80e5c69
Showing 1 changed file with 70 additions and 70 deletions.
140 changes: 70 additions & 70 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2410,35 +2410,35 @@ impl<'ctx> Builder<'ctx> {

unsafe { Ok(T::new(value)) }
}
///creates integer subtraction given `lhs` and `rhs`. It returns either an `IntValue` or `BuilderError`
///Creates integer subtraction given `lhs` and `rhs`. It returns either an `IntValue` or `BuilderError`
///```rust,no_run
///fn int_subtraction(lhs: i8, rhs: i8) -> i8{
/// lhs-rhs
/// }
///fn int_subtraction(lhs: i8, rhs: i8) -> i8 {
/// lhs-rhs
///}
/// ```
/// # Example in inkwell:
/// The rust code above demonstrates how the example below could have been written if it was rust:
///The rust code above demonstrates how the example below could have been written if it was rust:
///```rust,no_run
/// use inkwell::context::Context;
///use inkwell::context::Context;
///
/// // Setup
/// let context = Context::create();
/// let module = context.create_module("my_module");
/// let builder = context.create_builder();
/// let i8_type = context.i8_type();
/// let fn_type = i8_type.fn_type(&[i8_type.into(), i8_type.into()], false);
///let context = Context::create();
///let module = context.create_module("my_module");
///let builder = context.create_builder();
///let i8_type = context.i8_type();
///let fn_type = i8_type.fn_type(&[i8_type.into(), i8_type.into()], false);
///
/// // Function Definition
/// let function = module.add_function("int_subtraction", fn_type, None);
/// let value1 = function.get_first_param().unwrap().into_int_value();
/// let value2 = function.get_nth_param(1).unwrap().into_int_value();
/// let entry_block = context.append_basic_block(function, "entry");
///let function = module.add_function("int_subtraction", fn_type, None);
///let value1 = function.get_first_param().unwrap().into_int_value();
///let value2 = function.get_nth_param(1).unwrap().into_int_value();
///let entry_block = context.append_basic_block(function, "entry");
///
/// builder.position_at_end(entry_block);
///builder.position_at_end(entry_block);
///
/// let sub = builder.build_int_sub(value1, value2, "int_subtract").unwrap();
///let sub = builder.build_int_sub(value1, value2, "int_subtract").unwrap();
///
/// builder.build_return(Some(&sub)).unwrap();
///builder.build_return(Some(&sub)).unwrap();
///```
// SubType: <I>(&self, lhs: &IntValue<I>, rhs: &IntValue<I>, name: &str) -> IntValue<I> {
pub fn build_int_sub<T: IntMathValue<'ctx>>(&self, lhs: T, rhs: T, name: &str) -> Result<T, BuilderError> {
Expand Down Expand Up @@ -2473,35 +2473,35 @@ impl<'ctx> Builder<'ctx> {

unsafe { Ok(T::new(value)) }
}
///creates float subtraction given `lhs` and `rhs` as FloatValue. It returns either an `FloatValue` or `BuilderError`
///Creates float subtraction given `lhs` and `rhs` as FloatValue. It returns either an `FloatValue` or `BuilderError`
///```rust,no_run
///fn float_subtraction(lhs: f16, rhs: f16) -> f16{
/// lhs-rhs
/// }
///fn float_subtraction(lhs: f16, rhs: f16) -> f16 {
/// lhs-rhs
///}
/// ```
/// # Example in inkwell:
/// The rust code above demonstrates how the example below could have been written if it was rust:
///The rust code above demonstrates how the example below could have been written if it was rust:
///```rust,no_run
/// use inkwell::context::Context;
///use inkwell::context::Context;
///
/// // Setup
/// let context = Context::create();
/// let module = context.create_module("my_module");
/// let builder = context.create_builder();
/// let f16_type = context.f16_type();
/// let fn_type = f16_type.fn_type(&[f16_type.into(), f16_type.into()], false);
///let context = Context::create();
///let module = context.create_module("my_module");
///let builder = context.create_builder();
///let f16_type = context.f16_type();
///let fn_type = f16_type.fn_type(&[f16_type.into(), f16_type.into()], false);
///
/// // Function Definition
/// let function = module.add_function("float_subtraction", fn_type, None);
/// let value = function.get_first_param().unwrap().into_float_value();
/// let value2 = function.get_nth_param(1).unwrap().into_float_value();
/// let entry_block = context.append_basic_block(function, "entry");
///let function = module.add_function("float_subtraction", fn_type, None);
///let value = function.get_first_param().unwrap().into_float_value();
///let value2 = function.get_nth_param(1).unwrap().into_float_value();
///let entry_block = context.append_basic_block(function, "entry");
///
/// builder.position_at_end(entry_block);
///builder.position_at_end(entry_block);
///
/// let sub = builder.build_float_sub(value1, value2, "float_subtract").unwrap();
///let sub = builder.build_float_sub(value1, value2, "float_subtract").unwrap();
///
/// builder.build_return(Some(&sub)).unwrap();
///builder.build_return(Some(&sub)).unwrap();
///```
// SubType: <F>(&self, lhs: &FloatValue<F>, rhs: &FloatValue<F>, name: &str) -> FloatValue<F> {
pub fn build_float_sub<T: FloatMathValue<'ctx>>(&self, lhs: T, rhs: T, name: &str) -> Result<T, BuilderError> {
Expand All @@ -2513,36 +2513,36 @@ impl<'ctx> Builder<'ctx> {

unsafe { Ok(T::new(value)) }
}
///creates int multiplication given `lhs` and `rhs` as IntValue. It returns either an
///Creates int multiplication given `lhs` and `rhs` as IntValue. It returns either an
///`IntValue` or `BuilderError`
///```rust,no_run
///fn int_mul(lhs: i8, rhs: i8) -> i8{
/// lhs*rhs
/// }
///fn int_mul(lhs: i8, rhs: i8) -> i8 {
/// lhs*rhs
///}
/// ```
/// # Example in inkwell:
/// The rust code above demonstrates how the example below could have been written if it was rust:
///The rust code above demonstrates how the example below could have been written if it was rust:
///```rust,no_run
/// use inkwell::context::Context;
///use inkwell::context::Context;
///
/// // Setup
/// let context = Context::create();
/// let module = context.create_module("my_module");
/// let builder = context.create_builder();
/// let i8_type = context.i8_type();
/// let fn_type = i8_type.fn_type(&[i8_type.into(), i8_type.into()], false);
///let context = Context::create();
///let module = context.create_module("my_module");
///let builder = context.create_builder();
///let i8_type = context.i8_type();
///let fn_type = i8_type.fn_type(&[i8_type.into(), i8_type.into()], false);
///
/// // Function Definition
/// let function = module.add_function("float_subtraction", fn_type, None);
/// let value = function.get_first_param().unwrap().into_int_value();
/// let value2 = function.get_nth_param(1).unwrap().into_int_value();
/// let entry_block = context.append_basic_block(function, "entry");
///let function = module.add_function("float_subtraction", fn_type, None);
///let value = function.get_first_param().unwrap().into_int_value();
///let value2 = function.get_nth_param(1).unwrap().into_int_value();
///let entry_block = context.append_basic_block(function, "entry");
///
/// builder.position_at_end(entry_block);
///builder.position_at_end(entry_block);
///
/// let mul = builder.build_int_mul(value1, value2, "int_multiplication").unwrap();
///let mul = builder.build_int_mul(value1, value2, "int_multiplication").unwrap();
///
/// builder.build_return(Some(&mul)).unwrap();
///builder.build_return(Some(&mul)).unwrap();
///```
// SubType: <I>(&self, lhs: &IntValue<I>, rhs: &IntValue<I>, name: &str) -> IntValue<I> {
pub fn build_int_mul<T: IntMathValue<'ctx>>(&self, lhs: T, rhs: T, name: &str) -> Result<T, BuilderError> {
Expand Down Expand Up @@ -2578,36 +2578,36 @@ impl<'ctx> Builder<'ctx> {

unsafe { Ok(T::new(value)) }
}
///creates float multiplication
///Creates float multiplication
/// given `lhs` and `rhs` as FloatValue. It returns either an `FloatValue` or `BuilderError`
///```rust,no_run
///fn float_subtraction(lhs: f16, rhs: f16) -> f16{
/// lhs*rhs
/// lhs*rhs
/// }
/// ```
/// # Example in inkwell:
/// The rust code above demonstrates how the example below could have been written if it was rust:
///The rust code above demonstrates how the example below could have been written if it was rust:
///```rust,no_run
/// use inkwell::context::Context;
///use inkwell::context::Context;
///
/// // Setup
/// let context = Context::create();
/// let module = context.create_module("my_module");
/// let builder = context.create_builder();
/// let f16_type = context.f16_type();
/// let fn_type = f16_type.fn_type(&[f16_type.into(), f16_type.into()], false);
///let context = Context::create();
///let module = context.create_module("my_module");
///let builder = context.create_builder();
///let f16_type = context.f16_type();
///let fn_type = f16_type.fn_type(&[f16_type.into(), f16_type.into()], false);
///
/// // Function Definition
/// let function = module.add_function("float_subtraction", fn_type, None);
/// let value = function.get_first_param().unwrap().into_float_value();
/// let value2 = function.get_nth_param(1).unwrap().into_float_value();
/// let entry_block = context.append_basic_block(function, "entry");
///let function = module.add_function("float_subtraction", fn_type, None);
///let value = function.get_first_param().unwrap().into_float_value();
///let value2 = function.get_nth_param(1).unwrap().into_float_value();
///let entry_block = context.append_basic_block(function, "entry");
///
/// builder.position_at_end(entry_block);
///builder.position_at_end(entry_block);
///
/// let sub = builder.build_float_mul(value1, value2, "float_mul").unwrap();
///let sub = builder.build_float_mul(value1, value2, "float_mul").unwrap();
///
/// builder.build_return(Some(&sub)).unwrap();
///builder.build_return(Some(&sub)).unwrap();
///```
// SubType: <F>(&self, lhs: &FloatValue<F>, rhs: &FloatValue<F>, name: &str) -> FloatValue<F> {
pub fn build_float_mul<T: FloatMathValue<'ctx>>(&self, lhs: T, rhs: T, name: &str) -> Result<T, BuilderError> {
Expand Down

0 comments on commit 80e5c69

Please sign in to comment.