diff options
author | Kazu Hirata <kazu@google.com> | 2024-08-23 17:32:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-23 17:32:52 -0700 |
commit | dbd7ce0ccd3a88f2c1d6e47d31da63a48cafdc8f (patch) | |
tree | d1cbb40f2f30440f1c2ddf2b4cd475145de243d6 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | ca53611c905f82628ab2e40185307995b552e14d (diff) | |
download | llvm-dbd7ce0ccd3a88f2c1d6e47d31da63a48cafdc8f.zip llvm-dbd7ce0ccd3a88f2c1d6e47d31da63a48cafdc8f.tar.gz llvm-dbd7ce0ccd3a88f2c1d6e47d31da63a48cafdc8f.tar.bz2 |
[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<K, V, std::less<>>) in a subsequent patch. The
problem is that changing the type affects many places. Using a type
alias reduces the impact.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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<std::string, GVSummaryMapTy> *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<std::string, GVSummaryMapTy> - *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<std::string, GVSummaryMapTy> *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<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex, + const ModuleToSummariesForIndexTy *ModuleToSummariesForIndex, const GVSummaryPtrSet *DecSummaries) { SmallVector<char, 0> Buffer; Buffer.reserve(256 * 1024); |