From 7c7e1b3ab8aa2ce23bc10480e8b9c81873c10565 Mon Sep 17 00:00:00 2001 From: lyken Date: Tue, 27 Aug 2024 17:04:02 +0800 Subject: [PATCH] Model::{sizeof -> size_of} --- nac3core/src/codegen/model/core.rs | 2 +- nac3core/src/codegen/model/ptr.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nac3core/src/codegen/model/core.rs b/nac3core/src/codegen/model/core.rs index 25faeea5..5ff34d10 100644 --- a/nac3core/src/codegen/model/core.rs +++ b/nac3core/src/codegen/model/core.rs @@ -71,7 +71,7 @@ pub trait Model<'ctx>: fmt::Debug + Clone + Copy { fn get_type(&self, generator: &G, ctx: &'ctx Context) -> Self::Type; /// Get the number of bytes of the [`BasicType`] of this model. - fn sizeof( + fn size_of( &self, generator: &mut G, ctx: &'ctx Context, diff --git a/nac3core/src/codegen/model/ptr.rs b/nac3core/src/codegen/model/ptr.rs index e2d61288..956b02f3 100644 --- a/nac3core/src/codegen/model/ptr.rs +++ b/nac3core/src/codegen/model/ptr.rs @@ -199,7 +199,7 @@ impl<'ctx, Item: Model<'ctx>> Instance<'ctx, Ptr> { num_items: IntValue<'ctx>, ) { // Force extend `num_items` and `itemsize` to `i64` so their types would match. - let itemsize = self.model.sizeof(generator, ctx.ctx); + let itemsize = self.model.size_of(generator, ctx.ctx); let itemsize = Int(Int64).z_extend_or_truncate(generator, ctx, itemsize); let num_items = Int(Int64).z_extend_or_truncate(generator, ctx, num_items); let totalsize = itemsize.mul(ctx, num_items);