@@ -142,18 +142,17 @@ void StableFunctionMapRecord::serialize(
142142 &IndexOperandHashesByteSize, 1 );
143143}
144144
145- void StableFunctionMapRecord::deserializeEntry (
146- const unsigned char *Ptr, stable_hash Hash, StableFunctionMap *FunctionMap,
147- bool ReadStableFunctionMapNames) {
148- assert (FunctionMap->ReadStableFunctionMapNames == ReadStableFunctionMapNames);
145+ void StableFunctionMapRecord::deserializeEntry (const unsigned char *Ptr,
146+ stable_hash Hash,
147+ StableFunctionMap *FunctionMap) {
149148 auto FunctionNameId =
150149 endian::readNext<uint32_t , endianness::little, unaligned>(Ptr);
151- if (ReadStableFunctionMapNames)
150+ if (FunctionMap-> ReadStableFunctionMapNames )
152151 assert (FunctionMap->getNameForId (FunctionNameId) &&
153152 " FunctionNameId out of range" );
154153 auto ModuleNameId =
155154 endian::readNext<uint32_t , endianness::little, unaligned>(Ptr);
156- if (ReadStableFunctionMapNames)
155+ if (FunctionMap-> ReadStableFunctionMapNames )
157156 assert (FunctionMap->getNameForId (ModuleNameId) &&
158157 " ModuleNameId out of range" );
159158 auto InstCount =
@@ -191,7 +190,6 @@ void StableFunctionMapRecord::deserializeEntry(
191190}
192191
193192void StableFunctionMapRecord::deserialize (const unsigned char *&Ptr,
194- bool ReadStableFunctionMapNames,
195193 bool Lazy) {
196194 // Assert that Ptr is 4-byte aligned
197195 assert (((uintptr_t )Ptr % 4 ) == 0 );
@@ -204,8 +202,7 @@ void StableFunctionMapRecord::deserialize(const unsigned char *&Ptr,
204202 const auto NamesByteSize =
205203 endian::readNext<uint64_t , endianness::little, unaligned>(Ptr);
206204 const auto NamesOffset = reinterpret_cast <uintptr_t >(Ptr);
207- FunctionMap->ReadStableFunctionMapNames = ReadStableFunctionMapNames;
208- if (ReadStableFunctionMapNames) {
205+ if (FunctionMap->ReadStableFunctionMapNames ) {
209206 for (unsigned I = 0 ; I < NumNames; ++I) {
210207 StringRef Name (reinterpret_cast <const char *>(Ptr));
211208 Ptr += Name.size () + 1 ;
@@ -243,7 +240,7 @@ void StableFunctionMapRecord::deserialize(const unsigned char *&Ptr,
243240 else
244241 deserializeEntry (
245242 reinterpret_cast <const unsigned char *>(FixedSizeFieldsOffset), Hash,
246- FunctionMap.get (), ReadStableFunctionMapNames );
243+ FunctionMap.get ());
247244 FixedSizeFieldsOffset += FixedSizeFieldsSizePerEntry;
248245 }
249246
@@ -256,17 +253,15 @@ void StableFunctionMapRecord::deserialize(const unsigned char *&Ptr,
256253 reinterpret_cast <uintptr_t >(Ptr) + IndexOperandHashesByteSize);
257254}
258255
259- void StableFunctionMapRecord::deserialize (const unsigned char *&Ptr,
260- bool ReadStableFunctionMapNames) {
261- deserialize (Ptr, ReadStableFunctionMapNames, /* Lazy=*/ false );
256+ void StableFunctionMapRecord::deserialize (const unsigned char *&Ptr) {
257+ deserialize (Ptr, /* Lazy=*/ false );
262258}
263259
264260void StableFunctionMapRecord::lazyDeserialize (
265- std::shared_ptr<MemoryBuffer> Buffer, uint64_t Offset,
266- bool ReadStableFunctionMapNames) {
261+ std::shared_ptr<MemoryBuffer> Buffer, uint64_t Offset) {
267262 const auto *Ptr = reinterpret_cast <const unsigned char *>(
268263 reinterpret_cast <uintptr_t >(Buffer->getBufferStart ()) + Offset);
269- deserialize (Ptr, ReadStableFunctionMapNames, /* Lazy=*/ true );
264+ deserialize (Ptr, /* Lazy=*/ true );
270265 FunctionMap->Buffer = std::move (Buffer);
271266}
272267
0 commit comments