Skip to content

Commit

Permalink
Rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Dec 6, 2024
1 parent d1c9b02 commit 398db9f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions melior/src/block_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ pub trait BlockExt<'ctx> {
&self,
context: &'ctx Context,
location: Location<'ctx>,
elem_type: Type<'ctx>,
num_elems: Value<'ctx, '_>,
element_type: Type<'ctx>,
element_count: Value<'ctx, '_>,
align: usize,
) -> Result<Value<'ctx, '_>, Error>;

Expand All @@ -207,7 +207,7 @@ pub trait BlockExt<'ctx> {
&self,
context: &'ctx Context,
location: Location<'ctx>,
elem_type: Type<'ctx>,
element_type: Type<'ctx>,
align: usize,
) -> Result<Value<'ctx, '_>, Error>;

Expand Down Expand Up @@ -264,7 +264,7 @@ pub trait BlockExt<'ctx> {
location: Location<'ctx>,
ptr: Value<'ctx, '_>,
indexes: &[GepIndex<'ctx, '_>],
elem_type: Type<'ctx>,
element_type: Type<'ctx>,
) -> Result<Value<'ctx, '_>, Error>;
}

Expand Down Expand Up @@ -568,19 +568,19 @@ impl<'ctx> BlockExt<'ctx> for Block<'ctx> {
&self,
context: &'ctx Context,
location: Location<'ctx>,
elem_type: Type<'ctx>,
num_elems: Value<'ctx, '_>,
element_type: Type<'ctx>,
element_count: Value<'ctx, '_>,
align: usize,
) -> Result<Value<'ctx, '_>, Error> {
let mut op = ods::llvm::alloca(
context,
pointer(context, 0),
num_elems,
TypeAttribute::new(elem_type),
element_count,
TypeAttribute::new(element_type),
location,
);

op.set_elem_type(TypeAttribute::new(elem_type));
op.set_element_type(TypeAttribute::new(element_type));
op.set_alignment(IntegerAttribute::new(
IntegerType::new(context, 64).into(),
align.try_into().unwrap(),
Expand All @@ -594,11 +594,11 @@ impl<'ctx> BlockExt<'ctx> for Block<'ctx> {
&self,
context: &'ctx Context,
location: Location<'ctx>,
elem_type: Type<'ctx>,
element_type: Type<'ctx>,
align: usize,
) -> Result<Value<'ctx, '_>, Error> {
let num_elems = self.const_int(context, location, 1, 64)?;
self.alloca(context, location, elem_type, num_elems, align)
let element_count = self.const_int(context, location, 1, 64)?;
self.alloca(context, location, element_type, element_count, align)
}

#[inline]
Expand All @@ -609,12 +609,12 @@ impl<'ctx> BlockExt<'ctx> for Block<'ctx> {
bits: u32,
align: usize,
) -> Result<Value<'ctx, '_>, Error> {
let num_elems = self.const_int(context, location, 1, 64)?;
let element_count = self.const_int(context, location, 1, 64)?;
self.alloca(
context,
location,
IntegerType::new(context, bits).into(),
num_elems,
element_count,
align,
)
}
Expand All @@ -626,7 +626,7 @@ impl<'ctx> BlockExt<'ctx> for Block<'ctx> {
location: Location<'ctx>,
ptr: Value<'ctx, '_>,
indexes: &[GepIndex<'ctx, '_>],
elem_type: Type<'ctx>,
element_type: Type<'ctx>,
) -> Result<Value<'ctx, '_>, Error> {
let mut dynamic_indices = Vec::with_capacity(indexes.len());
let mut raw_constant_indices = Vec::with_capacity(indexes.len());
Expand All @@ -647,7 +647,7 @@ impl<'ctx> BlockExt<'ctx> for Block<'ctx> {
ptr,
&dynamic_indices,
DenseI32ArrayAttribute::new(context, &raw_constant_indices),
TypeAttribute::new(elem_type),
TypeAttribute::new(element_type),
location,
);
op.set_inbounds(Attribute::unit(context));
Expand Down

0 comments on commit 398db9f

Please sign in to comment.