From 0f7b59f64cfd4f236afa68afbb0af7b2ca20a89f Mon Sep 17 00:00:00 2001 From: khyperia Date: Thu, 28 Jan 2021 13:09:16 +0100 Subject: [PATCH] Remove different OpNames that target the same ID --- crates/rustc_codegen_spirv/src/linker/duplicates.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/rustc_codegen_spirv/src/linker/duplicates.rs b/crates/rustc_codegen_spirv/src/linker/duplicates.rs index 5033dd7775..090f67d0d3 100644 --- a/crates/rustc_codegen_spirv/src/linker/duplicates.rs +++ b/crates/rustc_codegen_spirv/src/linker/duplicates.rs @@ -269,8 +269,8 @@ pub fn remove_duplicate_types(module: &mut Module) { .annotations .retain(|inst| anno_set.insert(inst.assemble())); // Same thing with OpName - let mut debug_set = HashSet::new(); - module - .debugs - .retain(|inst| debug_set.insert(inst.assemble())); + let mut name_ids = HashSet::new(); + module.debugs.retain(|inst| { + inst.class.opcode != Op::Name || name_ids.insert(inst.operands[0].unwrap_id_ref()) + }); }