- /// \brief Write sample profiles in \p S for function \p F.
- bool write(const Function &F, const FunctionSamples &S) {
- return write(F.getName(), S);
- }
-
- /// \brief Write all the sample profiles for all the functions in \p M.
- ///
- /// \returns true if the file was updated successfully. False, otherwise.
- bool write(const Module &M, StringMap<FunctionSamples> &P) {
- for (const auto &F : M) {
- StringRef Name = F.getName();
- if (!write(Name, P[Name]))
- return false;
- }
- return true;
- }
-