[PATCH] D23177: [CodeView] Decouple the type record deserialization from the visitor.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 14:52:20 PDT 2016


zturner added inline comments.

================
Comment at: include/llvm/DebugInfo/CodeView/TypeDeserializer.h:89
@@ +88,3 @@
+    CVRecord<TypeLeafKind> CVR;
+    CVR.Length = OldData.size() - Data.size();
+    CVR.Data = OldData.slice(0, CVR.Length);
----------------
majnemer wrote:
> Is it possible for OldData.size() to be less than Data.size()? Should we assert or return an error? Or is this literally not possible?
I don't think this is possible.  `deserializeRecord` is expected to set `Data` on output to the set of data that is leftover after consuming one record.  We can assert.

================
Comment at: tools/llvm-readobj/llvm-readobj.cpp:282-285
@@ -282,7 +281,6 @@
 
-void error(std::error_code EC) {
-  if (!EC)
+void error(std::error_code ec) {
+  if (!ec)
     return;
-
-  reportError(EC.message());
+  reportError(ec.message());
 }
----------------
majnemer wrote:
> ruiu wrote:
> > ec -> EC
> Why make this change?
Was an accident as a result of merging two patches where the order of the overloads was different.


https://reviews.llvm.org/D23177





More information about the llvm-commits mailing list