Use ErrorOr for the ::create factory on instrumented and sample profilers.
[oota-llvm.git] / include / llvm / ProfileData / SampleProfReader.h
index e9ceae5d83513d252d6ac90fbff46ca04608e441..c20b815b5d9d16b3296a3367fde0339f07d93a92 100644 (file)
@@ -92,9 +92,8 @@ public:
   }
 
   /// \brief Create a sample profile reader appropriate to the file format.
-  static std::error_code create(StringRef Filename,
-                                std::unique_ptr<SampleProfileReader> &Reader,
-                                LLVMContext &C);
+  static ErrorOr<std::unique_ptr<SampleProfileReader>>
+  create(StringRef Filename, LLVMContext &C);
 
 protected:
   /// \brief Map every function to its associated profile.