[Lldb-commits] [PATCH] Force iteration over FieldDecls and RecordDecls in deterministic order.

Zachary Turner zturner at google.com
Sat Mar 21 00:00:12 PDT 2015


================
Comment at: source/Expression/ClangASTSource.cpp:1543
@@ -1546,5 +1542,3 @@
 
-    for (typename MapType::iterator fi = source_map.begin(), fe = source_map.end();
-         fi != fe;
-         ++fi)
+    for (const auto &fi : source_list)
     {
----------------
Since I didn't call it out specifically in the CL, this is the line that was introducing the non-determinism when a DenseMap is used.

It would be possible to fix this by only copying the elements of the DenseMap<> out to a temporary list and sorting the list, but since iterating in a non-deterministic order is perilous, I will propose this change first.

http://reviews.llvm.org/D8512

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list