[PATCH] Anonymous namespaces are missing import DW_TAG_imported_module.

Romanova, Katya Katya_Romanova at playstation.sony.com
Tue Mar 10 00:01:56 PDT 2015


Hi Adrian,

>> Removing the line/file names would be great, because it would solve the LTO bug described in
>>  http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073801.html

I could modify my patch to remove line/file names for anonymous namespaces. 
BTW, was this bug fixed? I can't reproduce this assertion with the latest compiler...

>> but we need to be careful to not accidentally unique anonymous namespaces as outlined later in that thread.

How could I make sure that accidental uniquing is not happening? I simply wanted to skip generation of line/file number info for the anonymous namespace. Something like that (see below). Am I missing something?

-  addSourceLine(NDie, NS);
+  if (IsAnonymous) {
+    // For anonymous namespaces, add a DW_TAG_imported_module tag
+    // containing a DW_AT_import attribute with the reference to this
+    // namespace entry.
+    DIE &IDie = createAndAddDIE(dwarf::DW_TAG_imported_module, *ContextDIE);
+    addDIEEntry(IDie, dwarf::DW_AT_import, NDie);
+    addFlag(IDie, dwarf::DW_AT_artificial);
+  }
+  else
+    addSourceLine(NDie, NS);
   return &NDie;


Thanks!
Katya.



-----Original Message-----
From: Adrian Prantl [mailto:aprantl at apple.com] 
Sent: Tuesday, March 03, 2015 12:58 PM
To: reviews+D7895+public+7827be49c0b04087 at reviews.llvm.org
Cc: Romanova, Katya; Robinson, Paul; echristo at gmail.com; friss at apple.com; dexonsmith at apple.com; dblaikie at gmail.com; llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] Anonymous namespaces are missing import DW_TAG_imported_module.


> On Feb 27, 2015, at 1:53 PM, Katya Romanova <Katya_Romanova at playstation.sony.com> wrote:
> 
> Hi David,
> 
> Yes, these are exactly 4 differences that I wanted to point out. 
> The questionable differences are #1 and #3.
> 
> - GCC doesn't put line/file on a namespace, Clang does. Clang should 
> omit them for brevity
> 
> Should I remove generation of  line/file names for anonymous namespaces before I commit my change?

[Sorry for replying so late to this thread.] Removing the line/file names would be great, because it would solve the LTO bug described in
  http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073801.html
but we need to be careful to not accidentally unique anonymous namespaces as outlined later in that thread.

-- adrian

> 
> --GCC adds line/file on imported_module, Clang doesn't. Clang could add these, I'm not sure if any debugger cares - notionally they could do more accurate expression evaluation with that information (not using the using directive when the user is evaluating an expression in a context lexically prior to the using directive).
> Our debugger doesn't care. I'm not sure if other debuggers care. So, I won't do any changes with respect of this.
> 
> Is my latest patch look OK or should I change anything?
> 
> 
> http://reviews.llvm.org/D7895
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list