Add inline stack streaming to binary sample profiles.
[oota-llvm.git] / include / llvm / ProfileData / SampleProfReader.h
index 770d25ea52a616ccf0294d8d61a0ceba1e5e31b3..e2976e2efab75a7db3bb354ce3ad9598bb68def1 100644 (file)
@@ -157,6 +157,9 @@ protected:
   /// \brief Return true if we've reached the end of file.
   bool at_eof() const { return Data >= End; }
 
+  /// Read the contents of the given profile instance.
+  std::error_code readProfile(FunctionSamples &FProfile);
+
   /// \brief Points to the current location in the buffer.
   const uint8_t *Data;
 
@@ -189,7 +192,7 @@ struct SourceInfo {
   uint32_t Discriminator;
 };
 
-typedef std::vector<SourceInfo> SourceStack;
+typedef SmallVector<FunctionSamples *, 10> InlineCallStack;
 
 // Supported histogram types in GCC.  Currently, we only need support for
 // call target histograms.
@@ -220,12 +223,9 @@ public:
 
 protected:
   std::error_code readNameTable();
-  std::error_code addSourceCount(StringRef Name, const SourceStack &Src,
-                                 uint64_t Count);
-  std::error_code readOneFunctionProfile(const SourceStack &Stack, bool Update);
+  std::error_code readOneFunctionProfile(const InlineCallStack &InlineStack,
+                                         bool Update, uint32_t Offset);
   std::error_code readFunctionProfiles();
-  std::error_code readModuleGroup();
-  std::error_code readWorkingSet();
   std::error_code skipNextWord();
   template <typename T> ErrorOr<T> readNumber();
   ErrorOr<StringRef> readString();