2121#include " llvm/ADT/StringRef.h"
2222#include " llvm/ADT/iterator.h"
2323#include " llvm/ADT/iterator_range.h"
24+ #include " llvm/Object/BuildID.h"
2425#include " llvm/ProfileData/InstrProf.h"
2526#include " llvm/Support/Alignment.h"
2627#include " llvm/Support/Compiler.h"
@@ -42,6 +43,10 @@ namespace llvm {
4243
4344class IndexedInstrProfReader ;
4445
46+ namespace object {
47+ class BuildIDFetcher ;
48+ } // namespace object
49+
4550namespace coverage {
4651
4752class CoverageMappingReader ;
@@ -579,6 +584,13 @@ class CoverageMapping {
579584 ArrayRef<std::unique_ptr<CoverageMappingReader>> CoverageReaders,
580585 IndexedInstrProfReader &ProfileReader, CoverageMapping &Coverage);
581586
587+ // Load coverage records from file.
588+ static Error
589+ loadFromFile (StringRef Filename, StringRef Arch, StringRef CompilationDir,
590+ IndexedInstrProfReader &ProfileReader, CoverageMapping &Coverage,
591+ bool &DataFound,
592+ SmallVectorImpl<object::BuildID> *FoundBinaryIDs = nullptr );
593+
582594 // / Add a function record corresponding to \p Record.
583595 Error loadFunctionRecord (const CoverageMappingRecord &Record,
584596 IndexedInstrProfReader &ProfileReader);
@@ -604,8 +616,8 @@ class CoverageMapping {
604616 // / Ignores non-instrumented object files unless all are not instrumented.
605617 static Expected<std::unique_ptr<CoverageMapping>>
606618 load (ArrayRef<StringRef> ObjectFilenames, StringRef ProfileFilename,
607- ArrayRef<StringRef> Arches = std::nullopt ,
608- StringRef CompilationDir = " " );
619+ ArrayRef<StringRef> Arches = std::nullopt , StringRef CompilationDir = " " ,
620+ const object::BuildIDFetcher *BIDFetcher = nullptr );
609621
610622 // / The number of functions that couldn't have their profiles mapped.
611623 // /
0 commit comments