[llvm] r279211 - Constify some path in the bitcode writer (NFC)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 23:06:18 PDT 2016


Author: mehdi_amini
Date: Fri Aug 19 01:06:18 2016
New Revision: 279211

URL: http://llvm.org/viewvc/llvm-project?rev=279211&view=rev
Log:
Constify some path in the bitcode writer (NFC)

Modified:
    llvm/trunk/include/llvm/Bitcode/ReaderWriter.h
    llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp

Modified: llvm/trunk/include/llvm/Bitcode/ReaderWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/ReaderWriter.h?rev=279211&r1=279210&r2=279211&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/ReaderWriter.h (original)
+++ llvm/trunk/include/llvm/Bitcode/ReaderWriter.h Fri Aug 19 01:06:18 2016
@@ -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<std::string, GVSummaryMapTy>
+                        const std::map<std::string, GVSummaryMapTy>
                             *ModuleToSummariesForIndex = nullptr);
 
   /// isBitcodeWrapper - Return true if the given bytes are the magic bytes

Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=279211&r1=279210&r2=279211&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Fri Aug 19 01:06:18 2016
@@ -316,7 +316,7 @@ class IndexBitcodeWriter : public Bitcod
 
   /// 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<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex;
+  const std::map<std::string, GVSummaryMapTy> *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<char> &Buffer,
                      const ModuleSummaryIndex &Index,
-                     std::map<std::string, GVSummaryMapTy>
+                     const std::map<std::string, GVSummaryMapTy>
                          *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<std::string, GVSummaryMapTy>::iterator ModuleSummariesBack;
+    std::map<std::string, GVSummaryMapTy>::const_iterator ModuleSummariesBack;
     /// Iterator on outer ModuleToSummariesForIndex map.
-    std::map<std::string, GVSummaryMapTy>::iterator ModuleSummariesIter;
+    std::map<std::string, GVSummaryMapTy>::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<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex) {
+    const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex) {
   SmallVector<char, 0> Buffer;
   Buffer.reserve(256 * 1024);
 




More information about the llvm-commits mailing list