From 2346fe7de64bf8632d576d7154120c7ae6379111 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sun, 11 Oct 2020 16:16:39 +0200 Subject: [PATCH] Make some things private --- cranelift/simplejit/src/backend.rs | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/cranelift/simplejit/src/backend.rs b/cranelift/simplejit/src/backend.rs index 369561f06b..b5c5f1f87a 100644 --- a/cranelift/simplejit/src/backend.rs +++ b/cranelift/simplejit/src/backend.rs @@ -151,14 +151,14 @@ struct StackMapRecord { } #[derive(Clone)] -pub struct SimpleJITCompiledFunction { +struct SimpleJITCompiledFunction { code: *mut u8, size: usize, relocs: Vec, } #[derive(Clone)] -pub struct SimpleJITCompiledData { +struct SimpleJITCompiledData { storage: *mut u8, size: usize, relocs: Vec, @@ -451,8 +451,8 @@ impl<'simple_jit_backend> Module for SimpleJITModule { self.record_function_for_perf(ptr, size, &decl.name); - let mut reloc_sink = SimpleJITRelocSink::new(); - let mut stack_map_sink = SimpleJITStackMapSink::new(); + let mut reloc_sink = SimpleJITRelocSink::default(); + let mut stack_map_sink = SimpleJITStackMapSink::default(); unsafe { ctx.emit_to_memory( &*self.isa, @@ -673,14 +673,9 @@ fn lookup_with_dlsym(name: &str) -> *const u8 { } } +#[derive(Default)] struct SimpleJITRelocSink { - pub relocs: Vec, -} - -impl SimpleJITRelocSink { - pub fn new() -> Self { - Self { relocs: Vec::new() } - } + relocs: Vec, } impl RelocSink for SimpleJITRelocSink { @@ -729,16 +724,9 @@ impl RelocSink for SimpleJITRelocSink { } } +#[derive(Default)] struct SimpleJITStackMapSink { - pub stack_maps: Vec, -} - -impl SimpleJITStackMapSink { - pub fn new() -> Self { - Self { - stack_maps: Vec::new(), - } - } + stack_maps: Vec, } impl StackMapSink for SimpleJITStackMapSink {