In this recipe, we will look at some more transformational passes, which are more like of utility passes. We will look at the strip-debug-symbols
pass and the prune-eh
pass.
Write a test case for checking the strip-debug pass, which strips off the debug symbols from the test code:
$ cat teststripdebug.ll @x = common global i32 0 ; <i32*> [#uses=0] define void @foo() nounwind readnone optsize ssp { entry: tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !5, metadata !{}), !dbg !10 ret void, !dbg !11 } declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!13} !llvm.dbg.sp = !{!0} !llvm.dbg.lv.foo = !{!5} !llvm.dbg.gv = !{!8} !0 = !MDSubprogram(name: "foo", linkageName: "foo", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !12, scope: !1, type: ...