MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / with_srcloc

Method with_srcloc

cranelift/codegen/src/cursor.rs:56–62  ·  view source on GitHub ↗

Exchange this cursor for one with a set source location. This is intended to be used as a builder method: ``` # use cranelift_codegen::ir::{Function, Block, SourceLoc}; # use cranelift_codegen::cursor::{Cursor, FuncCursor}; fn edit_func(func: &mut Function, srcloc: SourceLoc) { let mut pos = FuncCursor::new(func).with_srcloc(srcloc); // Use `pos`... } ```

(mut self, srcloc: ir::SourceLoc)

Source from the content-addressed store, hash-verified

54 /// }
55 /// ```
56 fn with_srcloc(mut self, srcloc: ir::SourceLoc) -> Self
57 where
58 Self: Sized,
59 {
60 self.set_srcloc(srcloc);
61 self
62 }
63
64 /// Rebuild this cursor positioned at `pos`.
65 fn at_position(mut self, pos: CursorPosition) -> Self

Callers 1

cursorMethod · 0.80

Implementers 2

cursor.rscranelift/codegen/src/cursor.rs
layout.rscranelift/codegen/src/ir/layout.rs

Calls 1

set_srclocMethod · 0.45

Tested by

no test coverage detected