From 62e0f454a03d4989c1646563ba2e8d87c5753964 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 15 Apr 2015 22:29:27 +0000 Subject: DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable Remove 'inlinedAt:' from MDLocalVariable. Besides saving some memory (variables with it seem to be single largest `Metadata` contributer to memory usage right now in -g -flto builds), this stops optimization and backend passes from having to change local variables. The 'inlinedAt:' field was used by the backend in two ways: 1. To tell the backend whether and into what a variable was inlined. 2. To create a unique id for each inlined variable. Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg` attachment, and change the DWARF backend to use a typedef called `InlinedVariable` which is `std::pair`. This `DebugLoc` is already passed reliably through the backend (as verified by r234021). This commit removes the check from r234021, but I added a new check (that will survive) in r235048, and changed the `DIBuilder` API in r235041 to require a `!dbg` attachment whose 'scope:` is in the same `MDSubprogram` as the variable's. If this breaks your out-of-tree testcases, perhaps the script I used (mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778 in a moment. llvm-svn: 235050 --- llvm/test/DebugInfo/missing-abstract-variable.ll | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/test/DebugInfo/missing-abstract-variable.ll') diff --git a/llvm/test/DebugInfo/missing-abstract-variable.ll b/llvm/test/DebugInfo/missing-abstract-variable.ll index 84123cf34ae..a26afb73029 100644 --- a/llvm/test/DebugInfo/missing-abstract-variable.ll +++ b/llvm/test/DebugInfo/missing-abstract-variable.ll @@ -160,13 +160,13 @@ attributes #2 = { nounwind readnone } !22 = !{i32 2, !"Debug Info Version", i32 3} !23 = !{!"clang version 3.5.0 "} !24 = !{i1 false} -!25 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11, inlinedAt: !26) +!25 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11) !26 = !MDLocation(line: 14, scope: !4) !27 = !MDLocation(line: 5, scope: !14, inlinedAt: !26) !28 = !MDLocation(line: 10, scope: !14, inlinedAt: !26) !29 = !MDLocation(line: 15, scope: !4) !30 = !MDLocation(line: 17, scope: !8) -!31 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11, inlinedAt: !32) +!31 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "b", line: 5, arg: 1, scope: !14, file: !5, type: !11) !32 = !MDLocation(line: 18, scope: !8) !33 = !MDLocation(line: 5, scope: !14, inlinedAt: !32) !34 = !MDLocation(line: 6, scope: !19, inlinedAt: !32) @@ -175,7 +175,7 @@ attributes #2 = { nounwind readnone } !37 = !{!"int", !38, i64 0} !38 = !{!"omnipotent char", !39, i64 0} !39 = !{!"Simple C/C++ TBAA"} -!40 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "s", line: 7, scope: !18, file: !5, type: !20, inlinedAt: !32) +!40 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "s", line: 7, scope: !18, file: !5, type: !20) !41 = !MDLocation(line: 8, scope: !18, inlinedAt: !32) !42 = !MDLocation(line: 9, scope: !18, inlinedAt: !32) !43 = !MDLocation(line: 10, scope: !14, inlinedAt: !32) -- cgit v1.2.3