Skip to content

Commit dcbb730

Browse files
[CGData] Drop const from a return type (NFC)
While I am at it, this patch adjusts the caller as we cannot hang onto a non-const return value with a reference.
1 parent 95202ab commit dcbb730

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/CGData/StableFunctionMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct StableFunctionMap {
7878
const HashFuncsMapType &getFunctionMap() const { return HashToFuncs; }
7979

8080
/// Get the NameToId vector for serialization.
81-
const SmallVector<std::string> getNames() const { return IdToName; }
81+
SmallVector<std::string> getNames() const { return IdToName; }
8282

8383
/// Get an existing ID associated with the given name or create a new ID if it
8484
/// doesn't exist.

llvm/lib/CGData/StableFunctionMapRecord.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void StableFunctionMapRecord::serialize(raw_ostream &OS,
8686
support::endian::Writer Writer(OS, endianness::little);
8787

8888
// Write Names.
89-
auto &Names = FunctionMap->getNames();
89+
const auto Names = FunctionMap->getNames();
9090
uint32_t ByteSize = 4;
9191
Writer.write<uint32_t>(Names.size());
9292
for (auto &Name : Names) {

0 commit comments

Comments
 (0)