@@ -212,15 +212,16 @@ struct FuncMemData {
212212// / Similar to BranchInfo, but instead of recording from-to address (an edge),
213213// / it records the address of a perf event and the number of times samples hit
214214// / this address.
215- struct SampleInfo {
215+ struct BasicSampleInfo {
216216 Location Loc;
217217 int64_t Hits;
218218
219- SampleInfo (Location Loc, int64_t Hits) : Loc(std::move(Loc)), Hits(Hits) {}
219+ BasicSampleInfo (Location Loc, int64_t Hits)
220+ : Loc(std::move(Loc)), Hits(Hits) {}
220221
221- bool operator ==(const SampleInfo &RHS) const { return Loc == RHS.Loc ; }
222+ bool operator ==(const BasicSampleInfo &RHS) const { return Loc == RHS.Loc ; }
222223
223- bool operator <(const SampleInfo &RHS) const {
224+ bool operator <(const BasicSampleInfo &RHS) const {
224225 if (Loc < RHS.Loc )
225226 return true ;
226227
@@ -229,18 +230,18 @@ struct SampleInfo {
229230
230231 void print (raw_ostream &OS) const ;
231232
232- void mergeWith (const SampleInfo &SI);
233+ void mergeWith (const BasicSampleInfo &SI);
233234};
234235
235236// / Helper class to store samples recorded in the address space of a given
236237// / function, analogous to FuncBranchData but for samples instead of branches.
237- struct FuncSampleData {
238- typedef std::vector<SampleInfo > ContainerTy;
238+ struct FuncBasicSampleData {
239+ typedef std::vector<BasicSampleInfo > ContainerTy;
239240
240241 StringRef Name;
241242 ContainerTy Data;
242243
243- FuncSampleData (StringRef Name, ContainerTy Data)
244+ FuncBasicSampleData (StringRef Name, ContainerTy Data)
244245 : Name(Name), Data(std::move(Data)) {}
245246
246247 // / Get the number of samples recorded in [Start, End)
@@ -308,7 +309,7 @@ class DataReader : public ProfileReaderBase {
308309 // / The last step is to infer edge counts based on BB execution count. Note
309310 // / this is the opposite of the LBR way, where we infer BB execution count
310311 // / based on edge counts.
311- void readSampleData (BinaryFunction &BF);
312+ void readBasicSampleData (BinaryFunction &BF);
312313
313314 // / Convert function-level branch data into instruction annotations.
314315 void convertBranchData (BinaryFunction &BF) const ;
@@ -382,7 +383,8 @@ class DataReader : public ProfileReaderBase {
382383 // / Return mem data matching one of the names in \p FuncNames.
383384 FuncMemData *getMemDataForNames (const std::vector<StringRef> &FuncNames);
384385
385- FuncSampleData *getFuncSampleData (const std::vector<StringRef> &FuncNames);
386+ FuncBasicSampleData *
387+ getFuncBasicSampleData (const std::vector<StringRef> &FuncNames);
386388
387389 // / Return a vector of all FuncBranchData matching the list of names.
388390 // / Internally use fuzzy matching to match special names like LTO-generated
@@ -425,7 +427,7 @@ class DataReader : public ProfileReaderBase {
425427 }
426428
427429 using NamesToBranchesMapTy = std::map<StringRef, FuncBranchData>;
428- using NamesToSamplesMapTy = std::map<StringRef, FuncSampleData >;
430+ using NamesToBasicSamplesMapTy = std::map<StringRef, FuncBasicSampleData >;
429431 using NamesToMemEventsMapTy = std::map<StringRef, FuncMemData>;
430432 using FuncsToBranchesMapTy =
431433 std::unordered_map<const BinaryFunction *, FuncBranchData *>;
@@ -474,7 +476,7 @@ class DataReader : public ProfileReaderBase {
474476 return parseLocation (EndChar, EndNl, true );
475477 }
476478 ErrorOr<BranchInfo> parseBranchInfo ();
477- ErrorOr<SampleInfo > parseSampleInfo ();
479+ ErrorOr<BasicSampleInfo > parseSampleInfo ();
478480 ErrorOr<MemInfo> parseMemInfo ();
479481 ErrorOr<bool > maybeParseNoLBRFlag ();
480482 ErrorOr<bool > maybeParseBATFlag ();
@@ -488,7 +490,7 @@ class DataReader : public ProfileReaderBase {
488490 unsigned Line{0 };
489491 unsigned Col{0 };
490492 NamesToBranchesMapTy NamesToBranches;
491- NamesToSamplesMapTy NamesToSamples ;
493+ NamesToBasicSamplesMapTy NamesToBasicSamples ;
492494 NamesToMemEventsMapTy NamesToMemEvents;
493495 FuncsToBranchesMapTy FuncsToBranches;
494496 FuncsToMemDataMapTy FuncsToMemData;
0 commit comments