[PATCH] D19940: Convert PDB error handling into using std::error_code instead of custom error codes

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 12:40:37 PDT 2016


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

lgtm

It would be nice if we could test the error paths here better, but I'd rather not check in distinct corrupt PDBs for every error path. If we ever care about perfect error handling we will need to fuzz this.


================
Comment at: lib/DebugInfo/PDB/Raw/DbiStream.cpp:110
@@ +109,3 @@
+  if (Header->Age != InfoStream.get().getAge())
+    return make_error<RawError>(raw_error_code::corrupt_file,
+                                "DBI Age does not match PDB Age.");
----------------
Maybe write a helper like errorCorruptFile(StringRef) that you can call here in the return? It might save a line break on all these error paths. Up to you.


http://reviews.llvm.org/D19940





More information about the llvm-commits mailing list