[PATCH] D26040: [CodeView] Add CodeViewRecordIO for reading and writing, and use it for reading type records.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 18:09:26 PDT 2016


ruiu added inline comments.


================
Comment at: include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h:130-132
+  msf::StreamReader *Reader = nullptr;
+  msf::StreamWriter *Writer = nullptr;
+  bool IsWriting = false;
----------------
This invariant

  IsWriting == (Writer != nullptr)

always holds, so IsWriting is redundant. You could replace all occurrences of `if (IsWriting)` with `if (Writer)`.


================
Comment at: include/llvm/DebugInfo/CodeView/TypeRecord.h:55-56
+
+  explicit MemberAttributes(MemberAccess Access, MethodKind Kind,
+                            MethodOptions Flags) {
+    Attrs = static_cast<uint16_t>(Access);
----------------
`explicit` for a ctor with three parameters?


================
Comment at: include/llvm/DebugInfo/CodeView/TypeRecordMapping.h:37
+#include "TypeRecords.def"
+
+private:
----------------
Don't you want to #undef these macros after #include for safety?


https://reviews.llvm.org/D26040





More information about the llvm-commits mailing list