62
62
#define INSTR_PROF_VISIBILITY
63
63
#endif
64
64
65
+ // clang-format off:consider re-enabling clang-format if auto-formatted C macros
66
+ // are readable (e.g., after `issue #82426` is fixed)
65
67
/* INSTR_PROF_DATA start. */
66
68
/* Definition of member fields of the per-function control structure. */
67
69
#ifndef INSTR_PROF_DATA
@@ -494,12 +496,14 @@ getValueProfRecordHeaderSize(uint32_t NumValueSites);
494
496
#define offsetof (TYPE, MEMBER ) ((size_t ) &((TYPE *)0 )->MEMBER)
495
497
#endif
496
498
499
+ // clang-format on
500
+
497
501
/* !
498
502
* Return the \c ValueProfRecord header size including the
499
503
* padding bytes.
500
504
*/
501
- INSTR_PROF_VISIBILITY INSTR_PROF_INLINE
502
- uint32_t getValueProfRecordHeaderSize (uint32_t NumValueSites) {
505
+ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE uint32_t
506
+ getValueProfRecordHeaderSize (uint32_t NumValueSites) {
503
507
uint32_t Size = offsetof (ValueProfRecord, SiteCountArray) +
504
508
sizeof (uint8_t ) * NumValueSites;
505
509
/* Round the size to multiple of 8 bytes. */
@@ -511,27 +515,26 @@ uint32_t getValueProfRecordHeaderSize(uint32_t NumValueSites) {
511
515
* Return the total size of the value profile record including the
512
516
* header and the value data.
513
517
*/
514
- INSTR_PROF_VISIBILITY INSTR_PROF_INLINE
515
- uint32_t getValueProfRecordSize (uint32_t NumValueSites,
516
- uint32_t NumValueData) {
518
+ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE uint32_t
519
+ getValueProfRecordSize (uint32_t NumValueSites, uint32_t NumValueData) {
517
520
return getValueProfRecordHeaderSize (NumValueSites) +
518
521
sizeof (InstrProfValueData) * NumValueData;
519
522
}
520
523
521
524
/* !
522
525
* Return the pointer to the start of value data array.
523
526
*/
524
- INSTR_PROF_VISIBILITY INSTR_PROF_INLINE
525
- InstrProfValueData * getValueProfRecordValueData (ValueProfRecord *This) {
527
+ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE InstrProfValueData *
528
+ getValueProfRecordValueData (ValueProfRecord *This) {
526
529
return (InstrProfValueData *)((char *)This + getValueProfRecordHeaderSize (
527
530
This->NumValueSites ));
528
531
}
529
532
530
533
/* !
531
534
* Return the total number of value data for \c This record.
532
535
*/
533
- INSTR_PROF_VISIBILITY INSTR_PROF_INLINE
534
- uint32_t getValueProfRecordNumValueData (ValueProfRecord *This) {
536
+ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE uint32_t
537
+ getValueProfRecordNumValueData (ValueProfRecord *This) {
535
538
uint32_t NumValueData = 0 ;
536
539
uint32_t I;
537
540
for (I = 0 ; I < This->NumValueSites ; I++)
@@ -542,8 +545,8 @@ uint32_t getValueProfRecordNumValueData(ValueProfRecord *This) {
542
545
/* !
543
546
* Use this method to advance to the next \c This \c ValueProfRecord.
544
547
*/
545
- INSTR_PROF_VISIBILITY INSTR_PROF_INLINE
546
- ValueProfRecord * getValueProfRecordNext (ValueProfRecord *This) {
548
+ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE ValueProfRecord *
549
+ getValueProfRecordNext (ValueProfRecord *This) {
547
550
uint32_t NumValueData = getValueProfRecordNumValueData (This);
548
551
return (ValueProfRecord *)((char *)This +
549
552
getValueProfRecordSize (This->NumValueSites ,
@@ -553,8 +556,8 @@ ValueProfRecord *getValueProfRecordNext(ValueProfRecord *This) {
553
556
/* !
554
557
* Return the first \c ValueProfRecord instance.
555
558
*/
556
- INSTR_PROF_VISIBILITY INSTR_PROF_INLINE
557
- ValueProfRecord * getFirstValueProfRecord (ValueProfData *This) {
559
+ INSTR_PROF_VISIBILITY INSTR_PROF_INLINE ValueProfRecord *
560
+ getFirstValueProfRecord (ValueProfData *This) {
558
561
return (ValueProfRecord *)((char *)This + sizeof (ValueProfData));
559
562
}
560
563
@@ -637,6 +640,8 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
637
640
638
641
/* ============================================================================*/
639
642
643
+ // clang-format off:consider re-enabling clang-format if auto-formatted C macros
644
+ // are readable (e.g., after `issue #82426` is fixed)
640
645
#ifndef INSTR_PROF_DATA_DEFINED
641
646
642
647
#ifndef INSTR_PROF_DATA_INC
@@ -903,6 +908,8 @@ int InstProfPopcountll(unsigned long long X) { return __builtin_popcountll(X); }
903
908
904
909
#endif /* defined(_MSC_VER) && !defined(__clang__) */
905
910
911
+ // clang-format on
912
+
906
913
/* Map an (observed) memop size value to the representative value of its range.
907
914
* For example, 5 -> 5, 22 -> 17, 99 -> 65, 256 -> 256, 1001 -> 513. */
908
915
INSTR_PROF_VISIBILITY INSTR_PROF_INLINE uint64_t
0 commit comments