Skip to content

Commit 80249bc

Browse files
Apply suggestions from code review
Co-authored-by: Kazu Hirata <[email protected]>
1 parent 4727529 commit 80249bc

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

llvm/include/llvm/ProfileData/DataAccessProf.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class DataAccessProfData {
9797

9898
/// Methods to add symbolized data access profile. Returns error if duplicated
9999
/// symbol names or content hashes are seen. The user of this class should
100-
/// aggregate counters that corresponds to the same symbol name or with the
100+
/// aggregate counters that correspond to the same symbol name or with the
101101
/// same string literal hash before calling 'add*' methods.
102102
Error setDataAccessProfile(SymbolID SymbolID, uint64_t AccessCount);
103103
/// Similar to the method above, for records with \p Locations representing
@@ -108,23 +108,24 @@ class DataAccessProfData {
108108
const llvm::SmallVector<DataLocation> &Locations);
109109
Error addKnownSymbolWithoutSamples(SymbolID SymbolID);
110110

111-
/// Returns a iterable StringRef for strings in the order they are added.
111+
/// Returns an iterable StringRef for strings in the order they are added.
112+
/// Each string may be a symbol name or a file name.
112113
auto getStrings() const {
113114
ArrayRef<std::pair<StringRef, uint64_t>> RefSymbolNames(
114115
StrToIndexMap.begin(), StrToIndexMap.end());
115116
return llvm::make_first_range(RefSymbolNames);
116117
}
117118

118119
/// Returns array reference for various internal data structures.
119-
inline ArrayRef<
120+
ArrayRef<
120121
std::pair<std::variant<StringRef, uint64_t>, DataAccessProfRecord>>
121122
getRecords() const {
122123
return Records.getArrayRef();
123124
}
124-
inline ArrayRef<StringRef> getKnownColdSymbols() const {
125+
ArrayRef<StringRef> getKnownColdSymbols() const {
125126
return KnownColdSymbols.getArrayRef();
126127
}
127-
inline ArrayRef<uint64_t> getKnownColdHashes() const {
128+
ArrayRef<uint64_t> getKnownColdHashes() const {
128129
return KnownColdHashes.getArrayRef();
129130
}
130131

llvm/include/llvm/ProfileData/InstrProf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ void createPGONameMetadata(GlobalObject &GO, StringRef PGOName);
357357
/// the duplicated profile variables for Comdat functions.
358358
bool needsComdatForCounter(const GlobalObject &GV, const Module &M);
359359

360-
/// \c NameStrings is a string composed of one of more possibly encoded
360+
/// \c NameStrings is a string composed of one or more possibly encoded
361361
/// sub-strings. The substrings are separated by 0 or more zero bytes. This
362362
/// method decodes the string and calls `NameCallback` for each substring.
363363
Error readAndDecodeStrings(StringRef NameStrings,

llvm/lib/ProfileData/DataAccessProf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Error DataAccessProfData::serializeSymbolsAndFilenames(ProfOStream &OS) const {
141141
// Record the length of compressed string.
142142
OS.write(CompressedStringLen);
143143
// Write the chars in compressed strings.
144-
for (auto &c : CompressedStrings)
144+
for (char C : CompressedStrings)
145145
OS.writeByte(static_cast<uint8_t>(c));
146146
// Pad up to a multiple of 8.
147147
// InstrProfReader could read bytes according to 'CompressedStringLen'.

0 commit comments

Comments
 (0)