Remapper: remove debug info for IDs stripped in other passes
If some DCE is performed such as removing dead functions, then even
if we are NOT stripping debug info, we still must remove the debug
opcodes that refer to the now-dead IDs.
Also, this adds a small change to perform no ID remapping if none
is requested, making spirv-remap properly be a no-op if no options
are given.
diff --git a/Test/baseResults/remap.basic.dcefunc.frag.out b/Test/baseResults/remap.basic.dcefunc.frag.out
index 99b4d55..c28d90a 100644
--- a/Test/baseResults/remap.basic.dcefunc.frag.out
+++ b/Test/baseResults/remap.basic.dcefunc.frag.out
@@ -3,34 +3,33 @@
// Module Version 10000
// Generated by (magic number): 80001
-// Id's are bound by 19
+// Id's are bound by 22
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
- EntryPoint Fragment 4 "main" 14 16
+ EntryPoint Fragment 4 "main" 17 19
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
Name 4 "main"
- Name 9 "dead_fn("
- Name 14 "outf4"
- Name 16 "inf"
+ Name 17 "outf4"
+ Name 19 "inf"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 3
8: TypeFunction 7(fvec3)
- 10: 6(float) Constant 0
- 11: 7(fvec3) ConstantComposite 10 10 10
- 12: TypeVector 6(float) 4
- 13: TypePointer Output 12(fvec4)
- 14(outf4): 13(ptr) Variable Output
- 15: TypePointer Input 6(float)
- 16(inf): 15(ptr) Variable Input
+ 11: 6(float) Constant 0
+ 12: 7(fvec3) ConstantComposite 11 11 11
+ 15: TypeVector 6(float) 4
+ 16: TypePointer Output 15(fvec4)
+ 17(outf4): 16(ptr) Variable Output
+ 18: TypePointer Input 6(float)
+ 19(inf): 18(ptr) Variable Input
4(main): 2 Function None 3
5: Label
- 17: 6(float) Load 16(inf)
- 18: 12(fvec4) CompositeConstruct 17 17 17 17
- Store 14(outf4) 18
+ 20: 6(float) Load 19(inf)
+ 21: 15(fvec4) CompositeConstruct 20 20 20 20
+ Store 17(outf4) 21
Return
FunctionEnd