@@ -41,6 +41,7 @@ class DetailedRecordsEmitter {
41
41
void printVariables (raw_ostream &OS);
42
42
void printClasses (raw_ostream &OS);
43
43
void printRecords (raw_ostream &OS);
44
+ void printAllocationStats (raw_ostream &OS);
44
45
void printDefms (const Record &Rec, raw_ostream &OS);
45
46
void printTemplateArgs (const Record &Rec, raw_ostream &OS);
46
47
void printSuperclasses (const Record &Rec, raw_ostream &OS);
@@ -55,15 +56,15 @@ void DetailedRecordsEmitter::run(raw_ostream &OS) {
55
56
printVariables (OS);
56
57
printClasses (OS);
57
58
printRecords (OS);
59
+ printAllocationStats (OS);
58
60
}
59
61
60
62
// Print the report heading, including the source file name.
61
63
void DetailedRecordsEmitter::printReportHeading (raw_ostream &OS) {
62
64
OS << formatv (" DETAILED RECORDS for file {0}\n " , Records.getInputFilename ());
63
65
}
64
66
65
- // Print a section heading with the name of the section and
66
- // the item count.
67
+ // Print a section heading with the name of the section and the item count.
67
68
void DetailedRecordsEmitter::printSectionHeading (StringRef Title, int Count,
68
69
raw_ostream &OS) {
69
70
OS << formatv (" \n {0} {1} ({2}) {0}\n " , " --------------------" , Title, Count);
@@ -79,8 +80,7 @@ void DetailedRecordsEmitter::printVariables(raw_ostream &OS) {
79
80
OS << Var.first << " = " << Var.second ->getAsString () << ' \n ' ;
80
81
}
81
82
82
- // Print the classes, including the template arguments, superclasses,
83
- // and fields.
83
+ // Print classes, including the template arguments, superclasses, and fields.
84
84
void DetailedRecordsEmitter::printClasses (raw_ostream &OS) {
85
85
const auto &ClassList = Records.getClasses ();
86
86
printSectionHeading (" Classes" , ClassList.size (), OS);
@@ -94,8 +94,7 @@ void DetailedRecordsEmitter::printClasses(raw_ostream &OS) {
94
94
}
95
95
}
96
96
97
- // Print the records, including the defm sequences, supercasses,
98
- // and fields.
97
+ // Print the records, including the defm sequences, supercasses, and fields.
99
98
void DetailedRecordsEmitter::printRecords (raw_ostream &OS) {
100
99
const auto &RecordList = Records.getDefs ();
101
100
printSectionHeading (" Records" , RecordList.size (), OS);
@@ -110,6 +109,12 @@ void DetailedRecordsEmitter::printRecords(raw_ostream &OS) {
110
109
}
111
110
}
112
111
112
+ // Print memory allocation related stats.
113
+ void DetailedRecordsEmitter::printAllocationStats (raw_ostream &OS) {
114
+ OS << formatv (" \n {0} Memory Allocation Stats {0}\n " , " --------------------" );
115
+ Records.dumpAllocationStats (OS);
116
+ }
117
+
113
118
// Print the record's defm source locations, if any. Note that they
114
119
// are stored in the reverse order of their invocation.
115
120
void DetailedRecordsEmitter::printDefms (const Record &Rec, raw_ostream &OS) {
0 commit comments