pub struct StringCodegen { /* private fields */ }Expand description
Generates code for string operations.
Implementations§
Source§impl StringCodegen
impl StringCodegen
Sourcepub fn new(layout: StringLayout) -> Self
pub fn new(layout: StringLayout) -> Self
Create a new string codegen.
Sourcepub fn emit_string_lit(&mut self, value: &str) -> Vec<NativeInst>
pub fn emit_string_lit(&mut self, value: &str) -> Vec<NativeInst>
Emit a string literal allocation.
Sourcepub fn emit_string_append(
&mut self,
lhs: Register,
rhs: Register,
) -> Vec<NativeInst>
pub fn emit_string_append( &mut self, lhs: Register, rhs: Register, ) -> Vec<NativeInst>
Emit a string append operation.
Sourcepub fn emit_string_length(&mut self, str_reg: Register) -> Vec<NativeInst>
pub fn emit_string_length(&mut self, str_reg: Register) -> Vec<NativeInst>
Emit a string length query.
Sourcepub fn emit_string_eq(
&mut self,
lhs: Register,
rhs: Register,
) -> Vec<NativeInst>
pub fn emit_string_eq( &mut self, lhs: Register, rhs: Register, ) -> Vec<NativeInst>
Emit a string equality check.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StringCodegen
impl RefUnwindSafe for StringCodegen
impl Send for StringCodegen
impl Sync for StringCodegen
impl Unpin for StringCodegen
impl UnsafeUnpin for StringCodegen
impl UnwindSafe for StringCodegen
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more