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

Method ensure_user_func_name

cranelift/codegen/src/ir/function.rs:117–125  ·  view source on GitHub ↗

Retrieve a `UserExternalNameRef` for the given name, or add a new one. This method internally deduplicates same `UserExternalName` so they map to the same reference.

(&mut self, name: UserExternalName)

Source from the content-addressed store, hash-verified

115 /// This method internally deduplicates same `UserExternalName` so they map to the same
116 /// reference.
117 pub fn ensure_user_func_name(&mut self, name: UserExternalName) -> UserExternalNameRef {
118 if let Some(reff) = self.user_ext_name_to_ref.get(&name) {
119 *reff
120 } else {
121 let reff = self.user_named_funcs.push(name.clone());
122 self.user_ext_name_to_ref.insert(name, reff);
123 reff
124 }
125 }
126
127 /// Resets an already existing user function name to a new value.
128 pub fn reset_user_func_name(&mut self, index: UserExternalNameRef, name: UserExternalName) {

Callers 3

apply_func_renameMethod · 0.80
display_userFunction · 0.80

Calls 4

getMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45
insertMethod · 0.45

Tested by 1

display_userFunction · 0.64