[llvm] [llvm-profdata] Use simple enum for error checking in Sample Profile Reader (PR #67453)

Hongtao Yu via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 09:43:27 PDT 2023


================
@@ -604,48 +604,52 @@ class SampleProfileReaderBinary : public SampleProfileReader {
   /// EC is set.
   ///
   /// \returns the read value.
-  template <typename T> ErrorOr<T> readNumber();
+  template <typename T> sampleprof_error readNumber(T &Result);
----------------
htyu wrote:

I only see changes to the function declaration but not int he function implementation. Am I missing anything or it'll be included in a separate PR?

I also wonder how much end-to-end performance improvement did you see in your experiments? The `ErrorOr` usage is quite handy and prevailing in the code base.  

https://github.com/llvm/llvm-project/pull/67453


More information about the llvm-commits mailing list