From dbd7ce0ccd3a88f2c1d6e47d31da63a48cafdc8f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 23 Aug 2024 17:32:52 -0700 Subject: [IR] Inroduce ModuleToSummariesForIndexTy (NFC) (#105906) This patch introduces type alias ModuleToSummariesForIndexTy. I'm planning to change the type slightly to allow heterogeneous lookup (that is, std::map>) in a subsequent patch. The problem is that changing the type affects many places. Using a type alias reduces the impact. --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index e4b4339..2f3e90d 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -432,7 +432,7 @@ class IndexBitcodeWriter : public BitcodeWriterBase { /// When writing a subset of the index for distributed backends, client /// provides a map of modules to the corresponding GUIDs/summaries to write. - const std::map *ModuleToSummariesForIndex; + const ModuleToSummariesForIndexTy *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. @@ -461,11 +461,11 @@ public: /// If provided, \p DecSummaries specifies the set of summaries for which /// the corresponding functions or aliased functions should be imported as a /// declaration (but not definition) for each module. - IndexBitcodeWriter(BitstreamWriter &Stream, StringTableBuilder &StrtabBuilder, - const ModuleSummaryIndex &Index, - const GVSummaryPtrSet *DecSummaries = nullptr, - const std::map - *ModuleToSummariesForIndex = nullptr) + IndexBitcodeWriter( + BitstreamWriter &Stream, StringTableBuilder &StrtabBuilder, + const ModuleSummaryIndex &Index, + const GVSummaryPtrSet *DecSummaries = nullptr, + const ModuleToSummariesForIndexTy *ModuleToSummariesForIndex = nullptr) : BitcodeWriterBase(Stream, StrtabBuilder), Index(Index), DecSummaries(DecSummaries), ModuleToSummariesForIndex(ModuleToSummariesForIndex) { @@ -5102,7 +5102,7 @@ void BitcodeWriter::writeModule(const Module &M, void BitcodeWriter::writeIndex( const ModuleSummaryIndex *Index, - const std::map *ModuleToSummariesForIndex, + const ModuleToSummariesForIndexTy *ModuleToSummariesForIndex, const GVSummaryPtrSet *DecSummaries) { IndexBitcodeWriter IndexWriter(*Stream, StrtabBuilder, *Index, DecSummaries, ModuleToSummariesForIndex); @@ -5159,7 +5159,7 @@ void IndexBitcodeWriter::write() { // index for a distributed backend, provide a \p ModuleToSummariesForIndex map. void llvm::writeIndexToFile( const ModuleSummaryIndex &Index, raw_ostream &Out, - const std::map *ModuleToSummariesForIndex, + const ModuleToSummariesForIndexTy *ModuleToSummariesForIndex, const GVSummaryPtrSet *DecSummaries) { SmallVector Buffer; Buffer.reserve(256 * 1024); -- cgit v1.1