[PATCH] D32928: [CodeView] Allow random access visitation of type records

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 8 09:21:26 PDT 2017


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: llvm/include/llvm/DebugInfo/CodeView/TypeDatabase.h:48
+protected:
+  uint32_t zeroIndex(TypeIndex Index) const;
+
----------------
This could use a better name. `toArrayIndex`? `zeroBaseIndex`? `toZeroIndexed`?

And then after all that, a Doxygen comment would be good.


================
Comment at: llvm/lib/DebugInfo/CodeView/TypeDatabase.cpp:129
+uint32_t TypeDatabase::zeroIndex(TypeIndex Index) const {
+  return Index.getIndex() - TypeIndex::FirstNonSimpleIndex;
+}
----------------
This should assert that it's greater or equal than FirstNonSimpleIndex.


https://reviews.llvm.org/D32928





More information about the llvm-commits mailing list