[llvm] r193193 - DIEHashing: Provide an assert for unreachable functionality regarding friends.

David Blaikie dblaikie at gmail.com
Tue Oct 22 13:28:55 PDT 2013


Author: dblaikie
Date: Tue Oct 22 15:28:55 2013
New Revision: 193193

URL: http://llvm.org/viewvc/llvm-project?rev=193193&view=rev
Log:
DIEHashing: Provide an assert for unreachable functionality regarding friends.

Since (as of r190716) Clang no longer emits debug info for C++ friend
declarations (and it seems GCC never has/does, which was the motivation
for the Clang change), there's no actual reachable case for implementing
the part of DWARF 4, Section 7.27 part 5 that pertains to friends.

Leave an assert here so that if/when we do have a client producing
friends and using type units, we can fill in the gap and add appropriate
(unit and feature) tests.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp?rev=193193&r1=193192&r2=193193&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp Tue Oct 22 15:28:55 2013
@@ -200,6 +200,9 @@ void DIEHash::hashAttribute(AttrEntry At
   if (const DIEEntry *EntryAttr = dyn_cast<DIEEntry>(Value)) {
     DIE *Entry = EntryAttr->getEntry();
 
+    assert(Tag != dwarf::DW_TAG_friend && "No current LLVM clients emit friend "
+                                          "tags. Add support here when there's "
+                                          "a use case");
     // Step 5
     // If the tag in Step 3 is one of [the below tags]
     if ((Tag == dwarf::DW_TAG_pointer_type ||





More information about the llvm-commits mailing list