[PATCH] D42334: [NFC] Refactor Apple Accelerator Tables

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 20 20:18:11 PST 2018


aprantl added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfAccelTable.h:178
     DwarfStringPoolEntryRef Name;
-    std::vector<HashDataContents *> Values;
+    std::vector<DataT *> Values;
   };
----------------
Reading just the struct definition I'm a little puzzled why this needs to be a template if we are only storing a pointer to DataT. i wonder if we could get away with just templateizing one or two methods instead of the entire class.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfAccelTable.h:288
+  unsigned index = 0;
+  for (size_t i = 0, e = Buckets.size(); i < e; ++i) {
+    Asm->OutStreamer->AddComment("Bucket " + Twine(i));
----------------
Could you convert this to LLVM style with capitalized variable names?


================
Comment at: lib/CodeGen/AsmPrinter/DwarfAccelTable.h:326
+  for (size_t i = 0, e = Buckets.size(); i < e; ++i) {
+    for (auto HI = Buckets[i].begin(), HE = Buckets[i].end(); HI != HE; ++HI) {
+      uint32_t HashValue = (*HI)->HashValue;
----------------
does this look better as a range-based-for?


Repository:
  rL LLVM

https://reviews.llvm.org/D42334





More information about the llvm-commits mailing list