forked from OSchip/llvm-project
DetailedRecordsBackend.cpp - printSectionHeading - avoid std::string creation/copies.
Don't create std::string from constant c-strings or pass std::string by value - we can use StringRef instead.
This commit is contained in:
parent
a03d09f423
commit
d1b57086d5
|
@ -45,7 +45,7 @@ public:
|
||||||
void printVariables(raw_ostream &OS);
|
void printVariables(raw_ostream &OS);
|
||||||
void printClasses(raw_ostream &OS);
|
void printClasses(raw_ostream &OS);
|
||||||
void printRecords(raw_ostream &OS);
|
void printRecords(raw_ostream &OS);
|
||||||
void printSectionHeading(std::string Title, int Count, raw_ostream &OS);
|
void printSectionHeading(StringRef Title, int Count, raw_ostream &OS);
|
||||||
void printDefms(Record *Rec, raw_ostream &OS);
|
void printDefms(Record *Rec, raw_ostream &OS);
|
||||||
void printTemplateArgs(Record *Rec, raw_ostream &OS);
|
void printTemplateArgs(Record *Rec, raw_ostream &OS);
|
||||||
void printSuperclasses(Record *Rec, raw_ostream &OS);
|
void printSuperclasses(Record *Rec, raw_ostream &OS);
|
||||||
|
@ -113,7 +113,7 @@ void DetailedRecordsEmitter::printRecords(raw_ostream &OS) {
|
||||||
|
|
||||||
// Print a section heading with the name of the section and
|
// Print a section heading with the name of the section and
|
||||||
// the item count.
|
// the item count.
|
||||||
void DetailedRecordsEmitter::printSectionHeading(std::string Title, int Count,
|
void DetailedRecordsEmitter::printSectionHeading(StringRef Title, int Count,
|
||||||
raw_ostream &OS) {
|
raw_ostream &OS) {
|
||||||
OS << formatv("\n{0} {1} ({2}) {0}\n", "--------------------", Title, Count);
|
OS << formatv("\n{0} {1} ({2}) {0}\n", "--------------------", Title, Count);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue