[llvm] r264489 - Rename ModuleSummaryIndex::modPathStringEntries() into modulePaths()
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 25 20:35:38 PDT 2016
Author: mehdi_amini
Date: Fri Mar 25 22:35:38 2016
New Revision: 264489
URL: http://llvm.org/viewvc/llvm-project?rev=264489&view=rev
Log:
Rename ModuleSummaryIndex::modPathStringEntries() into modulePaths()
It now return the map instead of an iterator.
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/trunk/tools/llvm-lto/llvm-lto.cpp
Modified: llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h?rev=264489&r1=264488&r2=264489&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h (original)
+++ llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h Fri Mar 25 22:35:38 2016
@@ -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);
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=264489&r1=264488&r2=264489&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Fri Mar 25 22:35:38 2016
@@ -2827,7 +2827,7 @@ static void WriteModStrings(const Module
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;
Modified: llvm/trunk/tools/llvm-lto/llvm-lto.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-lto/llvm-lto.cpp?rev=264489&r1=264488&r2=264489&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-lto/llvm-lto.cpp (original)
+++ llvm/trunk/tools/llvm-lto/llvm-lto.cpp Fri Mar 25 22:35:38 2016
@@ -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);
More information about the llvm-commits
mailing list