Skip to content

Commit

Permalink
use the new SizeAlign64 type intended for upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetig committed Aug 3, 2024
1 parent a63d226 commit 2b747f1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct C {
needs_union_double_int64: bool,
prim_names: HashSet<String>,
world: String,
sizes: SizeAlign,
sizes: SizeAlign64,
renamed_interfaces: HashMap<WorldKey, String>,

world_id: Option<WorldId>,
Expand Down Expand Up @@ -2233,7 +2233,7 @@ impl<'a, 'b> FunctionBindgen<'a, 'b> {
impl Bindgen for FunctionBindgen<'_, '_> {
type Operand = String;

fn sizes(&self) -> &SizeAlign {
fn sizes(&self) -> &SizeAlign64 {
&self.gen.gen.sizes
}

Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub use wit_parser::abi::{AbiVariant, WasmSignature, WasmType};
use wit_parser::{
align_to_arch, Alignment, ArchitectureSize, ElementInfo, Enum, Flags, FlagsRepr, Function,
Handle, Int, Record, Resolve, Result_, Results, SizeAlign, Tuple, Type, TypeDefKind, TypeId,
Handle, Int, Record, Resolve, Result_, Results, SizeAlign64, Tuple, Type, TypeDefKind, TypeId,
Variant,
};

Expand Down Expand Up @@ -709,7 +709,7 @@ pub trait Bindgen {
fn finish_block(&mut self, operand: &mut Vec<Self::Operand>);

/// Returns size information that was previously calculated for all types.
fn sizes(&self) -> &SizeAlign;
fn sizes(&self) -> &SizeAlign64;

/// Returns whether or not the specified element type is represented in a
/// "canonical" form for lists. This dictates whether the `ListCanonLower`
Expand Down
10 changes: 5 additions & 5 deletions crates/cpp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use wit_bindgen_core::{
make_external_component, make_external_symbol, uwrite, uwriteln,
wit_parser::{
Alignment, ArchitectureSize, Docs, Function, FunctionKind, Handle, Int, InterfaceId,
Resolve, Results, SizeAlign, Stability, Type, TypeDefKind, TypeId, TypeOwner, WorldId,
Resolve, Results, SizeAlign64, Stability, Type, TypeDefKind, TypeId, TypeOwner, WorldId,
WorldKey,
},
Files, InterfaceGenerator, Source, WorldGenerator,
Expand Down Expand Up @@ -283,9 +283,9 @@ impl Cpp {
wasm_import_module: Option<String>,
) -> CppInterfaceGenerator<'a> {
let mut sizes = if self.opts.symmetric {
SizeAlign::new_symmetric()
SizeAlign64::new_symmetric()
} else {
SizeAlign::new()
SizeAlign64::default()
};
sizes.fill(resolve);

Expand Down Expand Up @@ -862,7 +862,7 @@ struct CppInterfaceGenerator<'a> {
resolve: &'a Resolve,
interface: Option<InterfaceId>,
_name: Option<&'a WorldKey>,
sizes: SizeAlign,
sizes: SizeAlign64,
in_guest_import: bool,
// return_pointer_area_size: usize,
// return_pointer_area_align: usize,
Expand Down Expand Up @@ -3708,7 +3708,7 @@ impl<'a, 'b> Bindgen for FunctionBindgen<'a, 'b> {
// uwriteln!(self.src, "// finish_block()");
}

fn sizes(&self) -> &wit_bindgen_core::wit_parser::SizeAlign {
fn sizes(&self) -> &wit_bindgen_core::wit_parser::SizeAlign64 {
&self.gen.sizes
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rust/src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl Bindgen for FunctionBindgen<'_, '_> {
format!("ptr{}", tmp)
}

fn sizes(&self) -> &SizeAlign {
fn sizes(&self) -> &SizeAlign64 {
&self.gen.sizes
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rust/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct InterfaceGenerator<'a> {
pub src: Source,
pub(super) identifier: Identifier<'a>,
pub in_import: bool,
pub sizes: SizeAlign,
pub sizes: SizeAlign64,
pub(super) gen: &'a mut RustWasm,
pub wasm_import_module: &'a str,
pub resolve: &'a Resolve,
Expand Down
4 changes: 2 additions & 2 deletions crates/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ impl RustWasm {
in_import: bool,
) -> InterfaceGenerator<'a> {
let mut sizes = if self.opts.symmetric {
SizeAlign::new_symmetric()
SizeAlign64::new_symmetric()
} else {
SizeAlign::new()
SizeAlign64::default()
};
sizes.fill(resolve);

Expand Down

0 comments on commit 2b747f1

Please sign in to comment.