[llvm] r330029 - [profile] Fix binary format reader error propagation.

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 13 08:04:37 PDT 2018


Author: mtrofin
Date: Fri Apr 13 08:04:36 2018
New Revision: 330029

URL: http://llvm.org/viewvc/llvm-project?rev=330029&view=rev
Log:
[profile] Fix binary format reader error propagation.

Summary:
This was originally part of rL328132, and led to the discovery
of the issues addressed in rL328987. Re-landing.

Reviewers: xur, davidxl, bkramer

Reviewed By: bkramer

Subscribers: llvm-commits

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

Modified:
    llvm/trunk/lib/ProfileData/InstrProfReader.cpp

Modified: llvm/trunk/lib/ProfileData/InstrProfReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=330029&r1=330028&r2=330029&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProfReader.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProfReader.cpp Fri Apr 13 08:04:36 2018
@@ -448,23 +448,23 @@ Error RawInstrProfReader<IntPtrT>::readN
   if (atEnd())
     // At this point, ValueDataStart field points to the next header.
     if (Error E = readNextHeader(getNextHeaderPos()))
-      return E;
+      return error(std::move(E));
 
   // Read name ad set it in Record.
   if (Error E = readName(Record))
-    return E;
+    return error(std::move(E));
 
   // Read FuncHash and set it in Record.
   if (Error E = readFuncHash(Record))
-    return E;
+    return error(std::move(E));
 
   // Read raw counts and set Record.
   if (Error E = readRawCounts(Record))
-    return E;
+    return error(std::move(E));
 
   // Read value data and set Record.
   if (Error E = readValueProfilingData(Record))
-    return E;
+    return error(std::move(E));
 
   // Iterate.
   advanceData();




More information about the llvm-commits mailing list