[PATCH] D14161: Remove the line number from DINamespace and thus decl_line/decl_file from DW_TAG_namespace.

Robinson, Paul via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 14:06:07 PDT 2016


Well, they're a complete waste of space in the DWARF, according to my debugger guys.  Although the benefit to removing them is small, it's not zero.
It sounds like removing them from the metadata would also be a good thing, again small but nonzero.
--paulr

From: llvm-commits [mailto:llvm-commits-bounces at lists.llvm.org] On Behalf Of David Blaikie via llvm-commits
Sent: Wednesday, October 12, 2016 11:14 AM
To: Duncan P. N. Exon Smith; reviews+D14161+public+3e8b35e2be7d6d98 at reviews.llvm.org
Cc: llvm-commits at lists.llvm.org
Subject: Re: [PATCH] D14161: Remove the line number from DINamespace and thus decl_line/decl_file from DW_TAG_namespace.

Really belated ping - just noticed namespaces still have decl line/file. Is this still worth doing at some point?

On Wed, Oct 28, 2015 at 4:37 PM Duncan P. N. Exon Smith via llvm-commits <llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>> wrote:

> On 2015-Oct-28, at 15:15, Adrian Prantl <aprantl at apple.com<mailto:aprantl at apple.com>> wrote:
>
> aprantl created this revision.
> aprantl added reviewers: dexonsmith, echristo, dblaikie.
> aprantl added a subscriber: llvm-commits.
> aprantl set the repository for this revision to rL LLVM.
>
> The file/line on DINamespace only serves one purpose and that is to prevent anonymous namespaces from different CUs from accidentally being uniqued. Since (C++) namespaces can be opened and closed in many different places, it makes no sense to put an arbitrary decl_file/decl_line on them and having it there prevents ODR type uniquing [example 1].
>
> This patch gets rid of the line number field in DINamespace. The file is still inherited from DIScope. CFE only attaches a DIFile when the namespace is anonymous. A more radical approach would be to drop the DIFile, too, and make anonymous namespaces distinct. I'll reserve this as the next incremental step.
>
> [1] https://web.archive.org/web/20140725222822/http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073801.html<https://web.archive.org/web/20140725222822/http:/lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073801.html>
>
> Repository:
>  rL LLVM
>
> http://reviews.llvm.org/D14161
>
> Files:
>  include/llvm/IR/DIBuilder.h
>  include/llvm/IR/DebugInfoMetadata.h
>  lib/AsmParser/LLParser.cpp
>  lib/Bitcode/Reader/BitcodeReader.cpp
>  lib/Bitcode/Writer/BitcodeWriter.cpp
>  lib/CodeGen/AsmPrinter/DwarfUnit.cpp
>  lib/CodeGen/AsmPrinter/DwarfUnit.h
>  lib/CodeGen/CGDebugInfo.cpp
>  lib/IR/AsmWriter.cpp
>  lib/IR/DIBuilder.cpp
>  lib/IR/DebugInfoMetadata.cpp
>  lib/IR/LLVMContextImpl.h
>  test/Assembler/dinamespace.ll
>  test/CodeGenCXX/debug-info-namespace.cpp
>  test/DebugInfo/Generic/namespace.ll
>  test/DebugInfo/X86/dwarf-public-names.ll
>  test/Modules/ExtDebugInfo.cpp
>  unittests/IR/MetadataTest.cpp
>
> <D14161.38690.patch>

I notice you missed updating LangRef.

I haven't had a chance to look in detail at the rest of the IR changes.  I'll
try to look in the next few days.
_______________________________________________
llvm-commits mailing list
llvm-commits at lists.llvm.org<mailto:llvm-commits at lists.llvm.org>
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161012/07bd9d2f/attachment.html>


More information about the llvm-commits mailing list