From f8e2e709f079f5aafc9d8cd67ee9401910d43fc1 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 20 May 2025 00:03:48 -0700 Subject: [CGData] Return ArrayRef in getNames (NFC) (#140675) All uses of getNames is read access to the list of names, so we can just return ArrayRef. There is no need to make a copy as we prepare a return value. --------- Co-authored-by: Matt Arsenault --- llvm/lib/CGData/StableFunctionMapRecord.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CGData/StableFunctionMapRecord.cpp') diff --git a/llvm/lib/CGData/StableFunctionMapRecord.cpp b/llvm/lib/CGData/StableFunctionMapRecord.cpp index e23b0e072c9a..537793b9e2b4 100644 --- a/llvm/lib/CGData/StableFunctionMapRecord.cpp +++ b/llvm/lib/CGData/StableFunctionMapRecord.cpp @@ -86,7 +86,7 @@ void StableFunctionMapRecord::serialize(raw_ostream &OS, support::endian::Writer Writer(OS, endianness::little); // Write Names. - auto &Names = FunctionMap->getNames(); + ArrayRef Names = FunctionMap->getNames(); uint32_t ByteSize = 4; Writer.write(Names.size()); for (auto &Name : Names) { -- cgit v1.2.3