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

Method merge

cranelift/module/src/module.rs:155–175  ·  view source on GitHub ↗
(a: Self, b: Self)

Source from the content-addressed store, hash-verified

153
154impl Linkage {
155 fn merge(a: Self, b: Self) -> Self {
156 match a {
157 Self::Export => Self::Export,
158 Self::Hidden => match b {
159 Self::Export => Self::Export,
160 Self::Preemptible => Self::Preemptible,
161 _ => Self::Hidden,
162 },
163 Self::Preemptible => match b {
164 Self::Export => Self::Export,
165 _ => Self::Preemptible,
166 },
167 Self::Local => match b {
168 Self::Export => Self::Export,
169 Self::Hidden => Self::Hidden,
170 Self::Preemptible => Self::Preemptible,
171 Self::Local | Self::Import => Self::Local,
172 },
173 Self::Import => b,
174 }
175 }
176
177 /// Test whether this linkage can have a definition.
178 pub fn is_definable(self) -> bool {

Callers 2

declare_functionMethod · 0.45
declare_dataMethod · 0.45

Calls 4

OkFunction · 0.85
into_ownedMethod · 0.80
linkage_nameMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected