@@ -117,14 +117,14 @@ size_t StableFunctionMap::size(SizeType Type) const {
117117 case UniqueHashCount:
118118 return HashToFuncs.size ();
119119 case TotalFunctionCount: {
120- const_cast <StableFunctionMap *>( this )-> deserializeLazyLoadingEntries ();
120+ deserializeLazyLoadingEntries ();
121121 size_t Count = 0 ;
122122 for (auto &Funcs : HashToFuncs)
123123 Count += Funcs.second .Entries .size ();
124124 return Count;
125125 }
126126 case MergeableFunctionCount: {
127- const_cast <StableFunctionMap *>( this )-> deserializeLazyLoadingEntries ();
127+ deserializeLazyLoadingEntries ();
128128 size_t Count = 0 ;
129129 for (auto &[Hash, Funcs] : HashToFuncs)
130130 if (Funcs.Entries .size () >= 2 )
@@ -144,18 +144,18 @@ StableFunctionMap::at(HashFuncsMapType::key_type FunctionHash) const {
144144}
145145
146146void StableFunctionMap::deserializeLazyLoadingEntry (
147- HashFuncsMapType::iterator It) {
147+ HashFuncsMapType::iterator It) const {
148148 assert (isLazilyLoaded () && " Cannot deserialize non-lazily-loaded map" );
149149 auto & [Hash, Storage] = *It;
150150 std::call_once (Storage.LazyLoadFlag , [this , HashArg = Hash, &StorageArg = Storage]() {
151151 for (auto Offset : StorageArg.Offsets )
152152 StableFunctionMapRecord::deserializeEntry (
153- reinterpret_cast <const unsigned char *>(Offset), HashArg, this ,
153+ reinterpret_cast <const unsigned char *>(Offset), HashArg, const_cast <StableFunctionMap *>( this ) ,
154154 ReadStableFunctionMapNames);
155155 });
156156}
157157
158- void :: StableFunctionMap::deserializeLazyLoadingEntries () {
158+ void StableFunctionMap::deserializeLazyLoadingEntries () const {
159159 if (!isLazilyLoaded ())
160160 return ;
161161 for (auto It = HashToFuncs.begin (); It != HashToFuncs.end (); ++It)
@@ -166,7 +166,7 @@ const StableFunctionMap::HashFuncsMapType &
166166StableFunctionMap::getFunctionMap () const {
167167 // Ensure all entries are deserialized before returning the raw map.
168168 if (isLazilyLoaded ())
169- const_cast <StableFunctionMap *>( this )-> deserializeLazyLoadingEntries ();
169+ deserializeLazyLoadingEntries ();
170170 return HashToFuncs;
171171}
172172
0 commit comments