/// \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;
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.
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();