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

Oleksiy Vyalov ovyalov at google.com
Mon Mar 23 14:28:05 PDT 2015


Do we need to use operator[] on vector? I'm wondering whether list can be used instead of vector.


================
Comment at: source/Expression/ClangASTSource.cpp:1541
@@ -1544,3 +1540,3 @@
 {
-    typedef llvm::DenseMap <const D*, O> MapType;
+    typedef std::vector<std::pair<const D *, O>> ListType;
 
----------------
Minor thing - destination_list.reserve(source_list.size())

================
Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2675
@@ -2673,2 +2674,3 @@
                         {
-                        llvm::DenseMap <const clang::FieldDecl *, uint64_t>::const_iterator pos, end = layout_info.field_offsets.end();
+                            std::vector<std::pair<const clang::FieldDecl *, uint64_t>>::const_iterator pos,
+                                end = layout_info.field_offsets.end();
----------------
Could you use cbegin and replace such a long type name with sth like
auto pos =  layout_info.field_offsets.cbegin(), end =  layout_info.field_offsets.cend();

http://reviews.llvm.org/D8512

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






More information about the lldb-commits mailing list