[PATCH] D20183: Enhance CodeView record deserialization with some template metaprogramming

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 17:32:34 PDT 2016


rnk added inline comments.

================
Comment at: include/llvm/DebugInfo/CodeView/RecordSerialization.h:54-58
@@ +53,7 @@
+
+/// Decode a numeric leaf value that is known to be a uint32_t.
+std::error_code consume(ArrayRef<uint8_t> &Data, uint64_t &Num);
+
+/// Decodes signed and unsigned fixed-length integers.
+std::error_code consume(ArrayRef<uint8_t> &Data, uint32_t &Item);
+std::error_code consume(StringRef &Data, uint32_t &Item);
----------------
Seems kind of awkward that uint64_t is a leaf numeric, but uint32_t is fixed length.

================
Comment at: include/llvm/DebugInfo/CodeView/RecordSerialization.h:141
@@ +140,3 @@
+// earlier.
+#define CONDITIONAL_FIELD(I, C)                                                \
+  serialize_conditional(I, [&]() { return !!(C); })
----------------
These macros have fairly generic names. We can prefix them with LLVM_, or we could hide them in TypeRecord.cpp along with all the deserialize method implementations.


http://reviews.llvm.org/D20183





More information about the llvm-commits mailing list