diff options
| -rw-r--r-- | llvm/include/llvm/IR/ModuleSummaryIndex.h | 11 | ||||
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 | ||||
| -rw-r--r-- | llvm/tools/llvm-lto/llvm-lto.cpp | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h index 1dd1e1450eb..30a7145cb42 100644 --- a/llvm/include/llvm/IR/ModuleSummaryIndex.h +++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h @@ -304,13 +304,14 @@ public: GlobalValueMap[ValueGUID].push_back(std::move(Info)); } - /// Iterator to allow writer to walk through table during emission. - iterator_range<StringMap<uint64_t>::const_iterator> - modPathStringEntries() const { - return llvm::make_range(ModulePathStringTable.begin(), - ModulePathStringTable.end()); + /// Table of modules, containing an id. + const StringMap<uint64_t> &modulePaths() const { + return ModulePathStringTable; } + /// Table of modules, containing an id. + StringMap<uint64_t> &modulePaths() { return ModulePathStringTable; } + /// Get the module ID recorded for the given module path. uint64_t getModuleId(const StringRef ModPath) const { return ModulePathStringTable.lookup(ModPath); diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 1d6054da79e..8284d55cefc 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -2827,7 +2827,7 @@ static void WriteModStrings(const ModuleSummaryIndex &I, unsigned Abbrev6Bit = Stream.EmitAbbrev(Abbv); SmallVector<unsigned, 64> NameVals; - for (const StringMapEntry<uint64_t> &MPSE : I.modPathStringEntries()) { + for (const StringMapEntry<uint64_t> &MPSE : I.modulePaths()) { StringEncoding Bits = getStringEncoding(MPSE.getKey().data(), MPSE.getKey().size()); unsigned AbbrevToUse = Abbrev8Bit; diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp index 16e6a9afc7d..1f7892de44b 100644 --- a/llvm/tools/llvm-lto/llvm-lto.cpp +++ b/llvm/tools/llvm-lto/llvm-lto.cpp @@ -281,7 +281,7 @@ std::vector<std::unique_ptr<MemoryBuffer>> loadAllFilesForIndex(const ModuleSummaryIndex &Index) { std::vector<std::unique_ptr<MemoryBuffer>> InputBuffers; - for (auto &ModPath : Index.modPathStringEntries()) { + for (auto &ModPath : Index.modulePaths()) { const auto &Filename = ModPath.first(); auto CurrentActivity = "loading file '" + Filename + "'"; auto InputOrErr = MemoryBuffer::getFile(Filename); |

