GDB and LLDB don't mind if we omit the explicit import of an anonymous namespace.
Diff Detail
Event Timeline
Ping. I did want to get this finished off (moving all triple-based decisions to tuning-based decisions) before 3.8 branches.
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
363–370 | This seems like overkill for a single case. |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | Why not just a positive for debugger tuning SCE? |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
363–370 | I suppose... having the big hairy test inline isn't *that* unreadable. | |
428–429 | Because the default (i.e., no tuning specified) behavior should be to conform to the DWARF spec, which basically says you need the explicit import. There's a new extra RUN line in the test, with no tuning specified, to verify this. |
FTR, the previous wiring-up-thru-Clang patches put the there-must-be-a-tuning decision in the driver; CC1 does not assume or require a non-default tuning.
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | I don't necessarily agree with that interpretation on the explicit import - I did skim the thread, perhaps you could highlight what makes you think this? |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | Basically, a namespace is a "context" for declarations, and the DWARF mechanism for making declarations from one context available in another context is with DW_TAG_imported_declaration and DW_TAG_imported_module. The meaning of DWARF is determined by the DWARF spec, not the C++ spec, and the DWARF spec does not say there's anything special about a namespace that has no name. There is a perfectly reasonable DWARF mechanism for getting the desired effect, so there's no reason for DWARF to make a special rule for an unnamed namespace. Therefore, an anonymous namespace should be explicitly imported into the containing namespace. The explicit import would be marked artificial of course. |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | Ping. Have I missed something in the DWARF spec that makes you think my interpretation is incorrect? Wouldn't be the first time... |
Ping. FWIW in today's DWARF meeting, we agreed that the Appendix D example of an anonymous namespace should have an explicit import from the containing scope (see DWARF v4, Figure 57 on p.233; it was essentially unchanged in the v5 draft).
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | I don't have anything to add to the reasoning the David has given you. We both agree and let's just make this a positive tuning for SCE. |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | Fine. It'll be on just for SCE. |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | Please don't add that comment to this, I don't believe that it is valid or useful. |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | The DWARF committee disagrees with your validity opinion, but I will take the comment out. |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | Bring it up on the list then. |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | I brought it up during the document review; see my ping comment from Jan 28. |
lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
428–429 | I saw. If you want that to be a required element of the spec then we need to change multiple wordings in the DWARF spec. I think the right place to bring that up is with the committee. The example is perfectly valid DWARF with the import, it's just unnecessary. |
This seems like overkill for a single case.