Skip to content

Commit 53a2923

Browse files
committed
Revert "[InstrProf][compiler-rt] Enable MC/DC Support in LLVM Source-based Code Coverage (1/3)"
This seems to cause Clang to crash, see comments on the code review. Reverting until the problem can be investigated. > Part 1 of 3. This includes the LLVM back-end processing and profile > reading/writing components. compiler-rt changes are included. > > Differential Revision: https://reviews.llvm.org/D138846 This reverts commit a50486f.
1 parent af56c4a commit 53a2923

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+171
-1410
lines changed

clang/test/CodeGen/coverage-profile-raw-version.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clang_cc1 -debug-info-kind=standalone -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -o - %s | FileCheck %s
22
// RUN: %clang_cc1 -debug-info-kind=standalone -mllvm -debug-info-correlate -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -o - %s | FileCheck %s --check-prefix=DEBUG_INFO
33

4-
// CHECK: @__llvm_profile_raw_version = {{.*}}constant i64 9
5-
// DEBUG_INFO: @__llvm_profile_raw_version = {{.*}}constant i64 576460752303423497
4+
// CHECK: @__llvm_profile_raw_version = {{.*}}constant i64 8
5+
// DEBUG_INFO: @__llvm_profile_raw_version = {{.*}}constant i64 576460752303423496
66

77
int main() {
88
return 0;

compiler-rt/include/profile/InstrProfData.inc

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ INSTR_PROF_DATA(const uint64_t, llvm::Type::getInt64Ty(Ctx), FuncHash, \
7676
ConstantInt::get(llvm::Type::getInt64Ty(Ctx), \
7777
Inc->getHash()->getZExtValue()))
7878
INSTR_PROF_DATA(const IntPtrT, IntPtrTy, CounterPtr, RelativeCounterPtr)
79-
INSTR_PROF_DATA(const IntPtrT, IntPtrTy, BitmapPtr, RelativeBitmapPtr)
8079
/* This is used to map function pointers for the indirect call targets to
8180
* function name hashes during the conversion from raw to merged profile
8281
* data.
@@ -88,9 +87,7 @@ INSTR_PROF_DATA(IntPtrT, llvm::Type::getInt8PtrTy(Ctx), Values, \
8887
INSTR_PROF_DATA(const uint32_t, llvm::Type::getInt32Ty(Ctx), NumCounters, \
8988
ConstantInt::get(llvm::Type::getInt32Ty(Ctx), NumCounters))
9089
INSTR_PROF_DATA(const uint16_t, Int16ArrayTy, NumValueSites[IPVK_Last+1], \
91-
ConstantArray::get(Int16ArrayTy, Int16ArrayVals)) \
92-
INSTR_PROF_DATA(const uint32_t, llvm::Type::getInt32Ty(Ctx), NumBitmapBytes, \
93-
ConstantInt::get(llvm::Type::getInt32Ty(Ctx), NumBitmapBytes))
90+
ConstantArray::get(Int16ArrayTy, Int16ArrayVals))
9491
#undef INSTR_PROF_DATA
9592
/* INSTR_PROF_DATA end. */
9693

@@ -135,13 +132,9 @@ INSTR_PROF_RAW_HEADER(uint64_t, NumData, NumData)
135132
INSTR_PROF_RAW_HEADER(uint64_t, PaddingBytesBeforeCounters, PaddingBytesBeforeCounters)
136133
INSTR_PROF_RAW_HEADER(uint64_t, NumCounters, NumCounters)
137134
INSTR_PROF_RAW_HEADER(uint64_t, PaddingBytesAfterCounters, PaddingBytesAfterCounters)
138-
INSTR_PROF_RAW_HEADER(uint64_t, NumBitmapBytes, NumBitmapBytes)
139-
INSTR_PROF_RAW_HEADER(uint64_t, PaddingBytesAfterBitmapBytes, PaddingBytesAfterBitmapBytes)
140135
INSTR_PROF_RAW_HEADER(uint64_t, NamesSize, NamesSize)
141136
INSTR_PROF_RAW_HEADER(uint64_t, CountersDelta,
142137
(uintptr_t)CountersBegin - (uintptr_t)DataBegin)
143-
INSTR_PROF_RAW_HEADER(uint64_t, BitmapDelta,
144-
(uintptr_t)BitmapBegin - (uintptr_t)DataBegin)
145138
INSTR_PROF_RAW_HEADER(uint64_t, NamesDelta, (uintptr_t)NamesBegin)
146139
INSTR_PROF_RAW_HEADER(uint64_t, ValueKindLast, IPVK_Last)
147140
#undef INSTR_PROF_RAW_HEADER
@@ -274,9 +267,6 @@ INSTR_PROF_SECT_ENTRY(IPSK_data, \
274267
INSTR_PROF_SECT_ENTRY(IPSK_cnts, \
275268
INSTR_PROF_QUOTE(INSTR_PROF_CNTS_COMMON), \
276269
INSTR_PROF_CNTS_COFF, "__DATA,")
277-
INSTR_PROF_SECT_ENTRY(IPSK_bitmap, \
278-
INSTR_PROF_QUOTE(INSTR_PROF_BITS_COMMON), \
279-
INSTR_PROF_BITS_COFF, "__DATA,")
280270
INSTR_PROF_SECT_ENTRY(IPSK_name, \
281271
INSTR_PROF_QUOTE(INSTR_PROF_NAME_COMMON), \
282272
INSTR_PROF_NAME_COFF, "__DATA,")
@@ -656,11 +646,11 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
656646

657647
/* FIXME: Please remedy the fixme in the header before bumping the version. */
658648
/* Raw profile format version (start from 1). */
659-
#define INSTR_PROF_RAW_VERSION 9
649+
#define INSTR_PROF_RAW_VERSION 8
660650
/* Indexed profile format version (start from 1). */
661-
#define INSTR_PROF_INDEX_VERSION 11
651+
#define INSTR_PROF_INDEX_VERSION 10
662652
/* Coverage mapping format version (start from 0). */
663-
#define INSTR_PROF_COVMAP_VERSION 6
653+
#define INSTR_PROF_COVMAP_VERSION 5
664654

665655
/* Profile version is always of type uint64_t. Reserve the upper 8 bits in the
666656
* version for other variants of profile. We set the lowest bit of the upper 8
@@ -697,7 +687,6 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
697687
#define INSTR_PROF_DATA_COMMON __llvm_prf_data
698688
#define INSTR_PROF_NAME_COMMON __llvm_prf_names
699689
#define INSTR_PROF_CNTS_COMMON __llvm_prf_cnts
700-
#define INSTR_PROF_BITS_COMMON __llvm_prf_bits
701690
#define INSTR_PROF_VALS_COMMON __llvm_prf_vals
702691
#define INSTR_PROF_VNODES_COMMON __llvm_prf_vnds
703692
#define INSTR_PROF_COVMAP_COMMON __llvm_covmap
@@ -709,7 +698,6 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
709698
#define INSTR_PROF_DATA_COFF ".lprfd$M"
710699
#define INSTR_PROF_NAME_COFF ".lprfn$M"
711700
#define INSTR_PROF_CNTS_COFF ".lprfc$M"
712-
#define INSTR_PROF_BITS_COFF ".lprfb$M"
713701
#define INSTR_PROF_VALS_COFF ".lprfv$M"
714702
#define INSTR_PROF_VNODES_COFF ".lprfnd$M"
715703
#define INSTR_PROF_COVMAP_COFF ".lcovmap$M"
@@ -721,7 +709,6 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
721709
#define INSTR_PROF_DATA_SECT_NAME INSTR_PROF_DATA_COFF
722710
#define INSTR_PROF_NAME_SECT_NAME INSTR_PROF_NAME_COFF
723711
#define INSTR_PROF_CNTS_SECT_NAME INSTR_PROF_CNTS_COFF
724-
#define INSTR_PROF_BITS_SECT_NAME INSTR_PROF_BITS_COFF
725712
/* Array of pointers. Each pointer points to a list
726713
* of value nodes associated with one value site.
727714
*/
@@ -736,7 +723,6 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
736723
#define INSTR_PROF_DATA_SECT_NAME INSTR_PROF_QUOTE(INSTR_PROF_DATA_COMMON)
737724
#define INSTR_PROF_NAME_SECT_NAME INSTR_PROF_QUOTE(INSTR_PROF_NAME_COMMON)
738725
#define INSTR_PROF_CNTS_SECT_NAME INSTR_PROF_QUOTE(INSTR_PROF_CNTS_COMMON)
739-
#define INSTR_PROF_BITS_SECT_NAME INSTR_PROF_QUOTE(INSTR_PROF_BITS_COMMON)
740726
/* Array of pointers. Each pointer points to a list
741727
* of value nodes associated with one value site.
742728
*/

compiler-rt/lib/profile/InstrProfiling.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ COMPILER_RT_VISIBILITY void __llvm_profile_reset_counters(void) {
6060
(__llvm_profile_get_version() & VARIANT_MASK_BYTE_COVERAGE) ? 0xFF : 0;
6161
memset(I, ResetValue, E - I);
6262

63-
I = __llvm_profile_begin_bitmap();
64-
E = __llvm_profile_end_bitmap();
65-
memset(I, 0x0, E - I);
66-
6763
const __llvm_profile_data *DataBegin = __llvm_profile_begin_data();
6864
const __llvm_profile_data *DataEnd = __llvm_profile_end_data();
6965
const __llvm_profile_data *DI;

compiler-rt/lib/profile/InstrProfiling.h

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ const char *__llvm_profile_begin_names(void);
8888
const char *__llvm_profile_end_names(void);
8989
char *__llvm_profile_begin_counters(void);
9090
char *__llvm_profile_end_counters(void);
91-
char *__llvm_profile_begin_bitmap(void);
92-
char *__llvm_profile_end_bitmap(void);
9391
ValueProfNode *__llvm_profile_begin_vnodes();
9492
ValueProfNode *__llvm_profile_end_vnodes();
9593
uint32_t *__llvm_profile_begin_orderfile();
@@ -103,20 +101,20 @@ void __llvm_profile_reset_counters(void);
103101
/*!
104102
* \brief Merge profile data from buffer.
105103
*
106-
* Read profile data from buffer \p Profile and merge with in-process profile
107-
* counters and bitmaps. The client is expected to have checked or already
108-
* know the profile data in the buffer matches the in-process counter
109-
* structure before calling it. Returns 0 (success) if the profile data is
110-
* valid. Upon reading invalid/corrupted profile data, returns 1 (failure).
104+
* Read profile data form buffer \p Profile and merge with in-process profile
105+
* counters. The client is expected to have checked or already knows the profile
106+
* data in the buffer matches the in-process counter structure before calling
107+
* it. Returns 0 (success) if the profile data is valid. Upon reading
108+
* invalid/corrupted profile data, returns 1 (failure).
111109
*/
112110
int __llvm_profile_merge_from_buffer(const char *Profile, uint64_t Size);
113111

114112
/*! \brief Check if profile in buffer matches the current binary.
115113
*
116114
* Returns 0 (success) if the profile data in buffer \p Profile with size
117115
* \p Size was generated by the same binary and therefore matches
118-
* structurally the in-process counters and bitmaps. If the profile data in
119-
* buffer is not compatible, the interface returns 1 (failure).
116+
* structurally the in-process counters. If the profile data in buffer is
117+
* not compatible, the interface returns 1 (failure).
120118
*/
121119
int __llvm_profile_check_compatibility(const char *Profile,
122120
uint64_t Size);
@@ -278,10 +276,6 @@ uint64_t __llvm_profile_get_num_counters(const char *Begin, const char *End);
278276
/*! \brief Get the size of the profile counters section in bytes. */
279277
uint64_t __llvm_profile_get_counters_size(const char *Begin, const char *End);
280278

281-
/*! \brief Get the number of bytes in the profile bitmap section. */
282-
uint64_t __llvm_profile_get_num_bitmap_bytes(const char *Begin,
283-
const char *End);
284-
285279
/* ! \brief Given the sizes of the data and counter information, return the
286280
* number of padding bytes before and after the counters, and after the names,
287281
* in the raw profile.
@@ -292,9 +286,8 @@ uint64_t __llvm_profile_get_num_bitmap_bytes(const char *Begin,
292286
* needed to achieve that.
293287
*/
294288
void __llvm_profile_get_padding_sizes_for_counters(
295-
uint64_t DataSize, uint64_t CountersSize, uint64_t NumBitmapBytes,
296-
uint64_t NamesSize, uint64_t *PaddingBytesBeforeCounters,
297-
uint64_t *PaddingBytesAfterCounters, uint64_t *PaddingBytesAfterBitmap,
289+
uint64_t DataSize, uint64_t CountersSize, uint64_t NamesSize,
290+
uint64_t *PaddingBytesBeforeCounters, uint64_t *PaddingBytesAfterCounters,
298291
uint64_t *PaddingBytesAfterNames);
299292

300293
/*!

compiler-rt/lib/profile/InstrProfilingBuffer.c

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,11 @@ uint64_t __llvm_profile_get_size_for_buffer(void) {
4343
const __llvm_profile_data *DataEnd = __llvm_profile_end_data();
4444
const char *CountersBegin = __llvm_profile_begin_counters();
4545
const char *CountersEnd = __llvm_profile_end_counters();
46-
const char *BitmapBegin = __llvm_profile_begin_bitmap();
47-
const char *BitmapEnd = __llvm_profile_end_bitmap();
4846
const char *NamesBegin = __llvm_profile_begin_names();
4947
const char *NamesEnd = __llvm_profile_end_names();
5048

5149
return __llvm_profile_get_size_for_buffer_internal(
52-
DataBegin, DataEnd, CountersBegin, CountersEnd, BitmapBegin, BitmapEnd,
53-
NamesBegin, NamesEnd);
50+
DataBegin, DataEnd, CountersBegin, CountersEnd, NamesBegin, NamesEnd);
5451
}
5552

5653
COMPILER_RT_VISIBILITY
@@ -86,12 +83,6 @@ uint64_t __llvm_profile_get_counters_size(const char *Begin, const char *End) {
8683
__llvm_profile_counter_entry_size();
8784
}
8885

89-
COMPILER_RT_VISIBILITY
90-
uint64_t __llvm_profile_get_num_bitmap_bytes(const char *Begin,
91-
const char *End) {
92-
return (End - Begin);
93-
}
94-
9586
/// Calculate the number of padding bytes needed to add to \p Offset in order
9687
/// for (\p Offset + Padding) to be page-aligned.
9788
static uint64_t calculateBytesNeededToPageAlign(uint64_t Offset) {
@@ -111,16 +102,13 @@ static int needsCounterPadding(void) {
111102

112103
COMPILER_RT_VISIBILITY
113104
void __llvm_profile_get_padding_sizes_for_counters(
114-
uint64_t DataSize, uint64_t CountersSize, uint64_t NumBitmapBytes,
115-
uint64_t NamesSize, uint64_t *PaddingBytesBeforeCounters,
116-
uint64_t *PaddingBytesAfterCounters, uint64_t *PaddingBytesAfterBitmapBytes,
105+
uint64_t DataSize, uint64_t CountersSize, uint64_t NamesSize,
106+
uint64_t *PaddingBytesBeforeCounters, uint64_t *PaddingBytesAfterCounters,
117107
uint64_t *PaddingBytesAfterNames) {
118108
if (!needsCounterPadding()) {
119109
*PaddingBytesBeforeCounters = 0;
120110
*PaddingBytesAfterCounters =
121111
__llvm_profile_get_num_padding_bytes(CountersSize);
122-
*PaddingBytesAfterBitmapBytes =
123-
__llvm_profile_get_num_padding_bytes(NumBitmapBytes);
124112
*PaddingBytesAfterNames = __llvm_profile_get_num_padding_bytes(NamesSize);
125113
return;
126114
}
@@ -130,37 +118,31 @@ void __llvm_profile_get_padding_sizes_for_counters(
130118
*PaddingBytesBeforeCounters =
131119
calculateBytesNeededToPageAlign(sizeof(__llvm_profile_header) + DataSize);
132120
*PaddingBytesAfterCounters = calculateBytesNeededToPageAlign(CountersSize);
133-
*PaddingBytesAfterBitmapBytes =
134-
calculateBytesNeededToPageAlign(NumBitmapBytes);
135121
*PaddingBytesAfterNames = calculateBytesNeededToPageAlign(NamesSize);
136122
}
137123

138124
COMPILER_RT_VISIBILITY
139125
uint64_t __llvm_profile_get_size_for_buffer_internal(
140126
const __llvm_profile_data *DataBegin, const __llvm_profile_data *DataEnd,
141-
const char *CountersBegin, const char *CountersEnd, const char *BitmapBegin,
142-
const char *BitmapEnd, const char *NamesBegin, const char *NamesEnd) {
127+
const char *CountersBegin, const char *CountersEnd, const char *NamesBegin,
128+
const char *NamesEnd) {
143129
/* Match logic in __llvm_profile_write_buffer(). */
144130
const uint64_t NamesSize = (NamesEnd - NamesBegin) * sizeof(char);
145131
uint64_t DataSize = __llvm_profile_get_data_size(DataBegin, DataEnd);
146132
uint64_t CountersSize =
147133
__llvm_profile_get_counters_size(CountersBegin, CountersEnd);
148-
const uint64_t NumBitmapBytes =
149-
__llvm_profile_get_num_bitmap_bytes(BitmapBegin, BitmapEnd);
150134

151135
/* Determine how much padding is needed before/after the counters and after
152136
* the names. */
153137
uint64_t PaddingBytesBeforeCounters, PaddingBytesAfterCounters,
154-
PaddingBytesAfterNames, PaddingBytesAfterBitmapBytes;
138+
PaddingBytesAfterNames;
155139
__llvm_profile_get_padding_sizes_for_counters(
156-
DataSize, CountersSize, NumBitmapBytes, NamesSize,
157-
&PaddingBytesBeforeCounters, &PaddingBytesAfterCounters,
158-
&PaddingBytesAfterBitmapBytes, &PaddingBytesAfterNames);
140+
DataSize, CountersSize, NamesSize, &PaddingBytesBeforeCounters,
141+
&PaddingBytesAfterCounters, &PaddingBytesAfterNames);
159142

160143
return sizeof(__llvm_profile_header) + __llvm_write_binary_ids(NULL) +
161144
DataSize + PaddingBytesBeforeCounters + CountersSize +
162-
PaddingBytesAfterCounters + NumBitmapBytes +
163-
PaddingBytesAfterBitmapBytes + NamesSize + PaddingBytesAfterNames;
145+
PaddingBytesAfterCounters + NamesSize + PaddingBytesAfterNames;
164146
}
165147

166148
COMPILER_RT_VISIBILITY
@@ -178,11 +160,9 @@ COMPILER_RT_VISIBILITY int __llvm_profile_write_buffer(char *Buffer) {
178160
COMPILER_RT_VISIBILITY int __llvm_profile_write_buffer_internal(
179161
char *Buffer, const __llvm_profile_data *DataBegin,
180162
const __llvm_profile_data *DataEnd, const char *CountersBegin,
181-
const char *CountersEnd, const char *BitmapBegin, const char *BitmapEnd,
182-
const char *NamesBegin, const char *NamesEnd) {
163+
const char *CountersEnd, const char *NamesBegin, const char *NamesEnd) {
183164
ProfDataWriter BufferWriter;
184165
initBufferWriter(&BufferWriter, Buffer);
185166
return lprofWriteDataImpl(&BufferWriter, DataBegin, DataEnd, CountersBegin,
186-
CountersEnd, BitmapBegin, BitmapEnd, 0, NamesBegin,
187-
NamesEnd, 0);
167+
CountersEnd, 0, NamesBegin, NamesEnd, 0);
188168
}

compiler-rt/lib/profile/InstrProfilingFile.c

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -108,30 +108,21 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
108108
const __llvm_profile_data *DataEnd = __llvm_profile_end_data();
109109
const char *CountersBegin = __llvm_profile_begin_counters();
110110
const char *CountersEnd = __llvm_profile_end_counters();
111-
const char *BitmapBegin = __llvm_profile_begin_bitmap();
112-
const char *BitmapEnd = __llvm_profile_end_bitmap();
113111
const char *NamesBegin = __llvm_profile_begin_names();
114112
const char *NamesEnd = __llvm_profile_end_names();
115113
const uint64_t NamesSize = (NamesEnd - NamesBegin) * sizeof(char);
116114
uint64_t DataSize = __llvm_profile_get_data_size(DataBegin, DataEnd);
117115
uint64_t CountersSize =
118116
__llvm_profile_get_counters_size(CountersBegin, CountersEnd);
119-
uint64_t NumBitmapBytes =
120-
__llvm_profile_get_num_bitmap_bytes(BitmapBegin, BitmapEnd);
121117

122-
/* Check that the counter, bitmap, and data sections in this image are
118+
/* Check that the counter and data sections in this image are
123119
* page-aligned. */
124120
unsigned PageSize = getpagesize();
125121
if ((intptr_t)CountersBegin % PageSize != 0) {
126122
PROF_ERR("Counters section not page-aligned (start = %p, pagesz = %u).\n",
127123
CountersBegin, PageSize);
128124
return 1;
129125
}
130-
if ((intptr_t)BitmapBegin % PageSize != 0) {
131-
PROF_ERR("Bitmap section not page-aligned (start = %p, pagesz = %u).\n",
132-
BitmapBegin, PageSize);
133-
return 1;
134-
}
135126
if ((intptr_t)DataBegin % PageSize != 0) {
136127
PROF_ERR("Data section not page-aligned (start = %p, pagesz = %u).\n",
137128
DataBegin, PageSize);
@@ -141,11 +132,10 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
141132
/* Determine how much padding is needed before/after the counters and
142133
* after the names. */
143134
uint64_t PaddingBytesBeforeCounters, PaddingBytesAfterCounters,
144-
PaddingBytesAfterNames, PaddingBytesAfterBitmapBytes;
135+
PaddingBytesAfterNames;
145136
__llvm_profile_get_padding_sizes_for_counters(
146-
DataSize, CountersSize, NumBitmapBytes, NamesSize,
147-
&PaddingBytesBeforeCounters, &PaddingBytesAfterCounters,
148-
&PaddingBytesAfterBitmapBytes, &PaddingBytesAfterNames);
137+
DataSize, CountersSize, NamesSize, &PaddingBytesBeforeCounters,
138+
&PaddingBytesAfterCounters, &PaddingBytesAfterNames);
149139

150140
uint64_t PageAlignedCountersLength = CountersSize + PaddingBytesAfterCounters;
151141
uint64_t FileOffsetToCounters = CurrentFileOffset +
@@ -165,31 +155,6 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
165155
FileOffsetToCounters);
166156
return 1;
167157
}
168-
169-
/* Also mmap MCDC bitmap bytes. If there aren't any bitmap bytes, mmap()
170-
* will fail with EINVAL. */
171-
if (NumBitmapBytes == 0)
172-
return 0;
173-
174-
uint64_t PageAlignedBitmapLength =
175-
NumBitmapBytes + PaddingBytesAfterBitmapBytes;
176-
uint64_t FileOffsetToBitmap =
177-
CurrentFileOffset + sizeof(__llvm_profile_header) + DataSize +
178-
PaddingBytesBeforeCounters + CountersSize + PaddingBytesAfterCounters;
179-
void *BitmapMmap =
180-
mmap((void *)BitmapBegin, PageAlignedBitmapLength, PROT_READ | PROT_WRITE,
181-
MAP_FIXED | MAP_SHARED, Fileno, FileOffsetToBitmap);
182-
if (BitmapMmap != BitmapBegin) {
183-
PROF_ERR(
184-
"Continuous counter sync mode is enabled, but mmap() failed (%s).\n"
185-
" - BitmapBegin: %p\n"
186-
" - PageAlignedBitmapLength: %" PRIu64 "\n"
187-
" - Fileno: %d\n"
188-
" - FileOffsetToBitmap: %" PRIu64 "\n",
189-
strerror(errno), BitmapBegin, PageAlignedBitmapLength, Fileno,
190-
FileOffsetToBitmap);
191-
return 1;
192-
}
193158
return 0;
194159
}
195160
#elif defined(__ELF__) || defined(_WIN32)
@@ -232,8 +197,6 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
232197
const __llvm_profile_data *DataEnd = __llvm_profile_end_data();
233198
const char *CountersBegin = __llvm_profile_begin_counters();
234199
const char *CountersEnd = __llvm_profile_end_counters();
235-
const char *BitmapBegin = __llvm_profile_begin_bitmap();
236-
const char *BitmapEnd = __llvm_profile_end_bitmap();
237200
uint64_t DataSize = __llvm_profile_get_data_size(DataBegin, DataEnd);
238201
/* Get the file size. */
239202
uint64_t FileSize = 0;
@@ -255,11 +218,6 @@ static int mmapForContinuousMode(uint64_t CurrentFileOffset, FILE *File) {
255218

256219
/* Return the memory allocated for counters to OS. */
257220
lprofReleaseMemoryPagesToOS((uintptr_t)CountersBegin, (uintptr_t)CountersEnd);
258-
259-
/* BIAS MODE not supported yet for Bitmap (MCDC). */
260-
261-
/* Return the memory allocated for counters to OS. */
262-
lprofReleaseMemoryPagesToOS((uintptr_t)BitmapBegin, (uintptr_t)BitmapEnd);
263221
return 0;
264222
}
265223
#else

0 commit comments

Comments
 (0)