MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / clean_duplicates

Method clean_duplicates

src/oomir.rs:191–220  ·  view source on GitHub ↗

Remove duplicate methods and fields

(&mut self)

Source from the content-addressed store, hash-verified

189 let mut unique_methods = HashMap::default();
190 for (name, method) in methods.iter() {
191 unique_methods.insert(name.clone(), method.clone());
192 }
193 *methods = unique_methods;
194 }
195 }
196 }
197}
198
199#[derive(Debug, Clone, PartialEq)]
200pub struct Function {
201 pub name: String,
202 pub owner_class: Option<String>,
203 pub signature: Signature,
204 pub debug_variables: Vec<DebugVariable>,
205 pub body: CodeBlock,
206}
207
208#[derive(Debug, Clone, PartialEq, Eq, Hash)]
209pub struct Signature {
210 pub params: Vec<(String, Type)>,
211 pub ret: Box<Type>,
212 pub is_static: bool,
213}
214
215impl Signature {
216 /// Whether the first OOMIR parameter is represented by the JVM's implicit
217 /// receiver slot rather than appearing in the method descriptor.
218 pub fn has_implicit_jvm_receiver(&self) -> bool {
219 !self.is_static
220 && self
221 .params
222 .first()
223 .is_some_and(|(_, ty)| ty.is_jvm_reference_type())

Callers 1

oomir_to_jvm_bytecodeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected