From cc1fe9b9d6e4aca86633d72c933413c28e8d0726 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Fri, 19 Aug 2016 06:06:18 +0000 Subject: [PATCH] Constify some path in the bitcode writer (NFC) llvm-svn: 279211 --- llvm/include/llvm/Bitcode/ReaderWriter.h | 2 +- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/include/llvm/Bitcode/ReaderWriter.h b/llvm/include/llvm/Bitcode/ReaderWriter.h index 53deaae..0ff32d8 100644 --- a/llvm/include/llvm/Bitcode/ReaderWriter.h +++ b/llvm/include/llvm/Bitcode/ReaderWriter.h @@ -110,7 +110,7 @@ namespace llvm { /// index for a distributed backend, provide the \p ModuleToSummariesForIndex /// map. void WriteIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out, - std::map + const std::map *ModuleToSummariesForIndex = nullptr); /// isBitcodeWrapper - Return true if the given bytes are the magic bytes diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index eadef18..428bb11 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -316,7 +316,7 @@ class IndexBitcodeWriter : public BitcodeWriter { /// When writing a subset of the index for distributed backends, client /// provides a map of modules to the corresponding GUIDs/summaries to write. - std::map *ModuleToSummariesForIndex; + const std::map *ModuleToSummariesForIndex; /// Map that holds the correspondence between the GUID used in the combined /// index and a value id generated by this class to use in references. @@ -331,7 +331,7 @@ public: /// for a distributed backend, provide a \p ModuleToSummariesForIndex map. IndexBitcodeWriter(SmallVectorImpl &Buffer, const ModuleSummaryIndex &Index, - std::map + const std::map *ModuleToSummariesForIndex = nullptr) : BitcodeWriter(Buffer), Index(Index), ModuleToSummariesForIndex(ModuleToSummariesForIndex) { @@ -359,11 +359,11 @@ public: // ModuleToSummariesForIndex map: /// Points to the last element in outer ModuleToSummariesForIndex map. - std::map::iterator ModuleSummariesBack; + std::map::const_iterator ModuleSummariesBack; /// Iterator on outer ModuleToSummariesForIndex map. - std::map::iterator ModuleSummariesIter; + std::map::const_iterator ModuleSummariesIter; /// Iterator on an inner global variable summary map. - GVSummaryMapTy::iterator ModuleGVSummariesIter; + GVSummaryMapTy::const_iterator ModuleGVSummariesIter; // Iterators used when writing all summaries in the index: @@ -3840,7 +3840,7 @@ void IndexBitcodeWriter::writeIndex() { // index for a distributed backend, provide a \p ModuleToSummariesForIndex map. void llvm::WriteIndexToFile( const ModuleSummaryIndex &Index, raw_ostream &Out, - std::map *ModuleToSummariesForIndex) { + const std::map *ModuleToSummariesForIndex) { SmallVector Buffer; Buffer.reserve(256 * 1024); -- 2.7.4