From 814b8e91c74e9855e6962471b059327525604b1d Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Fri, 28 Aug 2015 20:26:49 +0000 Subject: DI: Require subprogram definitions to be distinct As a follow-up to r246098, require `DISubprogram` definitions (`isDefinition: true`) to be 'distinct'. Specifically, add an assembler check, a verifier check, and bitcode upgrading logic to combat testcase bitrot after the `DIBuilder` change. While working on the testcases, I realized that test/Linker/subprogram-linkonce-weak-odr.ll isn't relevant anymore. Its purpose was to check for a corner case in PR22792 where two subprogram definitions match exactly and share the same metadata node. The new verifier check, requiring that subprogram definitions are 'distinct', precludes that possibility. I updated almost all the IR with the following script: git grep -l -E -e '= !DISubprogram\(.* isDefinition: true' | grep -v test/Bitcode | xargs sed -i '' -e 's/= \(!DISubprogram(.*, isDefinition: true\)/= distinct \1/' Likely some variant of would work for out-of-tree testcases. llvm-svn: 246327 --- llvm/test/DebugInfo/2010-05-03-DisableFramePtr.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/test/DebugInfo/2010-05-03-DisableFramePtr.ll') diff --git a/llvm/test/DebugInfo/2010-05-03-DisableFramePtr.ll b/llvm/test/DebugInfo/2010-05-03-DisableFramePtr.ll index 157e2841b28..c67ed73dac6 100644 --- a/llvm/test/DebugInfo/2010-05-03-DisableFramePtr.ll +++ b/llvm/test/DebugInfo/2010-05-03-DisableFramePtr.ll @@ -19,7 +19,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone !llvm.dbg.cu = !{!3} !llvm.module.flags = !{!19} !0 = !DILocalVariable(name: "userUPP", line: 7, arg: 1, scope: !1, file: !2, type: !6) -!1 = !DISubprogram(name: "DisposeDMNotificationUPP", linkageName: "DisposeDMNotificationUPP", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !16, scope: null, type: !4) +!1 = distinct !DISubprogram(name: "DisposeDMNotificationUPP", linkageName: "DisposeDMNotificationUPP", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !16, scope: null, type: !4) !2 = !DIFile(filename: "t.c", directory: "/Users/echeng/LLVM/radars/r7937664/") !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: 0, file: !16, enums: !17, retainedTypes: !17, subprograms: !18) !4 = !DISubroutineType(types: !5) -- cgit v1.2.3