Skip to content

Commit 7f5df4b

Browse files
committed
add some comments
1 parent f4595c8 commit 7f5df4b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ class ProfiledCallGraph {
138138
}
139139

140140
private:
141+
// A helper to not recalculate FunctionId hash
141142
class PrehashedFunctionId {
142143
public:
143144
PrehashedFunctionId() = default;
@@ -146,6 +147,9 @@ class ProfiledCallGraph {
146147

147148
const FunctionId &GetId() const { return Id; }
148149

150+
// Implicit conversion for hash_value(PrehashedFunctionId) to work.
151+
// You are not supposed to use it directly, since it converts into
152+
// hash-represeting FunctionId and thus drops the Name, use `GetId` instead.
149153
operator FunctionId() const {
150154
return FunctionId{Hash};
151155
}

0 commit comments

Comments
 (0)