[llvm] r203142 - Move DIEEntry handling inside the main switch statement.

Eric Christopher echristo at gmail.com
Thu Mar 6 10:59:43 PST 2014


Author: echristo
Date: Thu Mar  6 12:59:42 2014
New Revision: 203142

URL: http://llvm.org/viewvc/llvm-project?rev=203142&view=rev
Log:
Move DIEEntry handling inside the main switch statement.
No functional change.

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=203142&r1=203141&r2=203142&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp Thu Mar  6 12:59:42 2014
@@ -286,14 +286,6 @@ void DIEHash::hashAttribute(AttrEntry At
   const DIEAbbrevData *Desc = Attr.Desc;
   dwarf::Attribute Attribute = Desc->getAttribute();
 
-  // 7.27 Step 3
-  // ... An attribute that refers to another type entry T is processed as
-  // follows:
-  if (const DIEEntry *EntryAttr = dyn_cast<DIEEntry>(Value)) {
-    hashDIEEntry(Attribute, Tag, *EntryAttr->getEntry());
-    return;
-  }
-
   // Other attribute values use the letter 'A' as the marker, and the value
   // consists of the form code (encoded as an unsigned LEB128 value) followed by
   // the encoding of the value according to the form code. To ensure
@@ -302,6 +294,12 @@ void DIEHash::hashAttribute(AttrEntry At
   // DW_FORM_string, and DW_FORM_block.
 
   switch (Value->getType()) {
+    // 7.27 Step 3
+    // ... An attribute that refers to another type entry T is processed as
+    // follows:
+  case DIEValue::isEntry:
+    hashDIEEntry(Attribute, Tag, *cast<DIEEntry>(Value)->getEntry());
+    break;
   case DIEValue::isInteger: {
     addULEB128('A');
     addULEB128(Attribute);
@@ -352,8 +350,6 @@ void DIEHash::hashAttribute(AttrEntry At
   case DIEValue::isExpr:
   case DIEValue::isLabel:
   case DIEValue::isDelta:
-    // These two were handled above.
-  case DIEValue::isEntry:
   case DIEValue::isTypeSignature:
     llvm_unreachable("Add support for additional value types.");
   }





More information about the llvm-commits mailing list