summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-03-26 03:35:38 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-03-26 03:35:38 +0000
commit385cf28829a30fa2dfb5b1dbb921ddae298debb2 (patch)
treeced714de71cbb1fe2937c732394c86e985921a99
parent11598143f4f53335eded50ce687d1489c8f38cea (diff)
downloadbcm5719-llvm-385cf28829a30fa2dfb5b1dbb921ddae298debb2.tar.gz
bcm5719-llvm-385cf28829a30fa2dfb5b1dbb921ddae298debb2.zip
Rename ModuleSummaryIndex::modPathStringEntries() into modulePaths()
It now return the map instead of an iterator. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264489
-rw-r--r--llvm/include/llvm/IR/ModuleSummaryIndex.h11
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp2
-rw-r--r--llvm/tools/llvm-lto/llvm-lto.cpp2
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);
OpenPOWER on IntegriCloud