[PGO] Extract VP data integrity check code into a helper function (NFC)
[oota-llvm.git] / include / llvm / ProfileData / InstrProf.h
index 778fe16c2e6db6acfe4cdff22ae61db5ff4ec178..3a1226662007fce351f5ec55de80384127fcf408 100644 (file)
@@ -506,6 +506,9 @@ typedef struct ValueProfData {
   /// Return a pointer to \c ValueProfData instance ready to be streamed.
   static std::unique_ptr<ValueProfData>
   serializeFrom(const InstrProfRecord &Record);
   /// Return a pointer to \c ValueProfData instance ready to be streamed.
   static std::unique_ptr<ValueProfData>
   serializeFrom(const InstrProfRecord &Record);
+  /// Check the integrity of the record. Return the error code when
+  /// an error is detected, otherwise return instrprof_error::success.
+  instrprof_error checkIntegrity();
   /// Return a pointer to \c ValueProfileData instance ready to be read.
   /// All data in the instance are properly byte swapped. The input
   /// data is assumed to be in little endian order.
   /// Return a pointer to \c ValueProfileData instance ready to be read.
   /// All data in the instance are properly byte swapped. The input
   /// data is assumed to be in little endian order.