[PATCH] Anonymous namespaces are missing import DW_TAG_imported_module.
David Blaikie
dblaikie at gmail.com
Fri Feb 27 14:11:35 PST 2015
In http://reviews.llvm.org/D7895#131608, @kromanova 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?
No - it seems like a simple orthogonal change that could go in before/after/whenever someone decides they care about it.
> --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.
*nod* if someone files a bug one day because a debugger cares, I'm happy to worry about it then.
> Is my latest patch look OK or should I change anything?
I still don't know if it's the right thing to do - I'm still sort of inclined to treating this as a debugger bug & avoiding the extra code/complexity in LLVM (though it's not a lot, of course).
================
Comment at: test/DebugInfo/anonymous-namespace.ll:12
@@ +11,3 @@
+; {
+; a = a+2;
+; return a;
----------------
You could simplify this to "return a"
It might be even simpler/smaller IR to drop the 'foo' function and just keep 'a' alive with a global variable:
int *b = &a;
http://reviews.llvm.org/D7895
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list