[lld] r293820 - Return Error instead of bool from mergeTypeStreams().

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 14:09:34 PST 2017

Author: ruiu
Date: Wed Feb  1 16:09:34 2017
New Revision: 293820

URL: http://llvm.org/viewvc/llvm-project?rev=293820&view=rev
Return Error instead of bool from mergeTypeStreams().

Previously, mergeTypeStreams returns only true or false, so it was
impossible to know the reason if it failed. This patch changes the
function signature so that it returns an Error object.

Differential Revision: https://reviews.llvm.org/D29362


Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=293820&r1=293819&r2=293820&view=diff
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Wed Feb  1 16:09:34 2017
@@ -96,8 +96,8 @@ static std::vector<uint8_t> mergeDebugT(
     msf::StreamReader Reader(Stream);
     if (auto EC = Reader.readArray(Types, Reader.getLength()))
       fatal(EC, "Reader::readArray failed");
-    if (!codeview::mergeTypeStreams(Builder, Types))
-      fatal("codeview::mergeTypeStreams failed");
+    if (auto Err = codeview::mergeTypeStreams(Builder, Types))
+      fatal(Err, "codeview::mergeTypeStreams failed");
   // Construct section contents.

More information about the llvm-commits mailing list