Skip to content

Commit 58ace30

Browse files
authored
[NFC][YAML] Replace iterators with simple getter (#130449)
To simplify #130382.
1 parent 3a0c33a commit 58ace30

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,8 @@ class CfiFunctionIndex {
13241324
return Index.end();
13251325
}
13261326

1327+
std::vector<StringRef> symbols() const { return {begin(), end()}; }
1328+
13271329
GUIDIterator guid_begin() const { return GUIDIterator(Index.begin()); }
13281330
GUIDIterator guid_end() const { return GUIDIterator(Index.end()); }
13291331
iterator_range<GUIDIterator> guids() const {

llvm/include/llvm/IR/ModuleSummaryIndexYAML.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,10 @@ template <> struct MappingTraits<ModuleSummaryIndex> {
347347
index.WithGlobalValueDeadStripping);
348348

349349
if (io.outputting()) {
350-
std::vector<StringRef> CfiFunctionDefs(index.CfiFunctionDefs.begin(),
351-
index.CfiFunctionDefs.end());
350+
auto CfiFunctionDefs = index.CfiFunctionDefs.symbols();
352351
llvm::sort(CfiFunctionDefs);
353352
io.mapOptional("CfiFunctionDefs", CfiFunctionDefs);
354-
std::vector<StringRef> CfiFunctionDecls(index.CfiFunctionDecls.begin(),
355-
index.CfiFunctionDecls.end());
353+
auto CfiFunctionDecls(index.CfiFunctionDecls.symbols());
356354
llvm::sort(CfiFunctionDecls);
357355
io.mapOptional("CfiFunctionDecls", CfiFunctionDecls);
358356
} else {

0 commit comments

Comments
 (0)