Skip to content

Commit 90046d7

Browse files
incorporate code review comments
1 parent 0b18c2d commit 90046d7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

llvm/include/llvm/ProfileData/SampleProf.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,10 @@ struct LineLocationHash {
324324

325325
LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const LineLocation &Loc);
326326

327-
/// Key represents the id of a vtable and value represents its count.
328-
/// TODO: Rename class FunctionId to SymbolId in a separate PR.
327+
/// Key represents type of a C++ polymorphic class type by its vtable and value
328+
/// represents its counter.
329+
/// TODO: The class name FunctionId should be renamed to SymbolId in a refactor
330+
/// change.
329331
using TypeCountMap = std::map<FunctionId, uint64_t>;
330332

331333
/// Write \p Map to the output stream. Keys are linearized using \p NameTable
@@ -1016,13 +1018,13 @@ class FunctionSamples {
10161018
return CallsiteSamples;
10171019
}
10181020

1019-
/// Return all the callsite type samples collected in the body of the
1020-
/// function.
1021+
/// Returns vtable access samples for the C++ types collcted in this function.
10211022
const CallsiteTypeMap &getCallsiteTypeCounts() const {
10221023
return VirtualCallsiteTypeCounts;
10231024
}
10241025

1025-
/// Returns the type samples for the un-drifted location of \p Loc.
1026+
/// Returns the vtable access samples for the C++ types at the un-drifted
1027+
/// location of \p Loc.
10261028
TypeCountMap &getTypeSamplesAt(const LineLocation &Loc) {
10271029
return VirtualCallsiteTypeCounts[mapIRLocToProfileLoc(Loc)];
10281030
}
@@ -1353,10 +1355,10 @@ class FunctionSamples {
13531355
/// collected in the call to baz() at line offset 8.
13541356
CallsiteSampleMap CallsiteSamples;
13551357

1356-
/// Map virtual callsites to the vtable from which they are loaded.
1358+
/// Map a virtual callsite to the list of accessed vtables and vtable counts.
1359+
/// The callsite is referenced by its source location.
13571360
///
1358-
/// Each entry is a mapping from the location to the list of vtables and their
1359-
/// sampled counts. For example, given:
1361+
/// For example, given:
13601362
///
13611363
/// void foo() {
13621364
/// ...

0 commit comments

Comments
 (0)