[PATCH] D19731: Parse PDB Name Hash Table

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 14:05:44 PDT 2016


majnemer added inline comments.

================
Comment at: lib/DebugInfo/PDB/Raw/NameHashTable.cpp:36-56
@@ +35,23 @@
+
+  switch (DC) {
+    do {
+      DC = 8;
+      Result ^= LongData[7];
+    case 7:
+      Result ^= LongData[6];
+    case 6:
+      Result ^= LongData[5];
+    case 5:
+      Result ^= LongData[4];
+    case 4:
+      Result ^= LongData[3];
+    case 3:
+      Result ^= LongData[2];
+    case 2:
+      Result ^= LongData[1];
+    case 1:
+      Result ^= LongData[0];
+    case 0:;
+    } while ((LongData += DC) < LongDataEnd);
+  }
+
----------------
Could we make this a simple for-loop and let the compiler unroll it?

================
Comment at: lib/DebugInfo/PDB/Raw/NameHashTable.cpp:98
@@ +97,3 @@
+
+  return (Hash * 1664525L + 1013904223L) % 0xFFFFFFFF;
+}
----------------
Hash is a `uint32_t`, does `% 0xFFFFFFFF` actually do anything?

================
Comment at: lib/DebugInfo/PDB/Raw/NameHashTable.cpp:153
@@ +152,3 @@
+  }
+  return 0xFFFFFFFF;
+}
----------------
Returning -1 isn't a great interface, who is supposed to call `getIndexForString` ?


http://reviews.llvm.org/D19731





More information about the llvm-commits mailing list