@@ -259,19 +259,16 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin,
259259 const uint64_t * CountersBegin , const uint64_t * CountersEnd ,
260260 VPDataReaderType * VPDataReader , const char * NamesBegin ,
261261 const char * NamesEnd , int SkipNameDataWrite ) {
262- int DebugInfoCorrelate =
263- (__llvm_profile_get_version () & VARIANT_MASK_DBG_CORRELATE ) != 0ULL ;
264262
265263 /* Calculate size of sections. */
266- const uint64_t DataSize =
267- DebugInfoCorrelate ? 0 : __llvm_profile_get_data_size (DataBegin , DataEnd );
264+ const uint64_t DataSize = __llvm_profile_get_data_size (DataBegin , DataEnd );
268265 const uint64_t CountersSize = CountersEnd - CountersBegin ;
269- const uint64_t NamesSize = DebugInfoCorrelate ? 0 : NamesEnd - NamesBegin ;
266+ const uint64_t NamesSize = NamesEnd - NamesBegin ;
270267
271268 /* Create the header. */
272269 __llvm_profile_header Header ;
273270
274- if (!DataSize && (! DebugInfoCorrelate || ! CountersSize ) )
271+ if (!DataSize )
275272 return 0 ;
276273
277274 /* Determine how much padding is needed before/after the counters and after
@@ -292,12 +289,6 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin,
292289 Header .CountersDelta = (uint32_t )Header .CountersDelta ;
293290#endif
294291
295- /* The data and names sections are omitted in lightweight mode. */
296- if (DebugInfoCorrelate ) {
297- Header .CountersDelta = 0 ;
298- Header .NamesDelta = 0 ;
299- }
300-
301292 /* Write the profile header. */
302293 ProfDataIOVec IOVec [] = {{& Header , sizeof (__llvm_profile_header ), 1 , 0 }};
303294 if (Writer -> Write (Writer , IOVec , sizeof (IOVec ) / sizeof (* IOVec )))
@@ -309,13 +300,11 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin,
309300
310301 /* Write the profile data. */
311302 ProfDataIOVec IOVecData [] = {
312- {DebugInfoCorrelate ? NULL : DataBegin , sizeof (__llvm_profile_data ),
313- DataSize , 0 },
303+ {DataBegin , sizeof (__llvm_profile_data ), DataSize , 0 },
314304 {NULL , sizeof (uint8_t ), PaddingBytesBeforeCounters , 1 },
315305 {CountersBegin , sizeof (uint64_t ), CountersSize , 0 },
316306 {NULL , sizeof (uint8_t ), PaddingBytesAfterCounters , 1 },
317- {(SkipNameDataWrite || DebugInfoCorrelate ) ? NULL : NamesBegin ,
318- sizeof (uint8_t ), NamesSize , 0 },
307+ {SkipNameDataWrite ? NULL : NamesBegin , sizeof (uint8_t ), NamesSize , 0 },
319308 {NULL , sizeof (uint8_t ), PaddingBytesAfterNames , 1 }};
320309 if (Writer -> Write (Writer , IOVecData , sizeof (IOVecData ) / sizeof (* IOVecData )))
321310 return -1 ;
0 commit comments