Remove different OpNames that target the same ID (#398)

This commit is contained in:
Ashley Hauck 2021-01-28 14:16:06 +01:00 committed by GitHub
parent 810ba5d1e4
commit 9f6c91c278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -269,8 +269,8 @@ pub fn remove_duplicate_types(module: &mut Module) {
.annotations .annotations
.retain(|inst| anno_set.insert(inst.assemble())); .retain(|inst| anno_set.insert(inst.assemble()));
// Same thing with OpName // Same thing with OpName
let mut debug_set = HashSet::new(); let mut name_ids = HashSet::new();
module module.debugs.retain(|inst| {
.debugs inst.class.opcode != Op::Name || name_ids.insert(inst.operands[0].unwrap_id_ref())
.retain(|inst| debug_set.insert(inst.assemble())); });
} }