[llvm] [NFC][TableGen] Refactor JSON and detailed record emitter (PR #105770)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 00:37:02 PDT 2024


================
@@ -68,14 +64,21 @@ void DetailedRecordsEmitter::printReportHeading(raw_ostream &OS) {
   OS << formatv("DETAILED RECORDS for file {0}\n", Records.getInputFilename());
 }
 
+// Print a section heading with the name of the section and
+// the item count.
+void DetailedRecordsEmitter::printSectionHeading(StringRef Title, int Count,
+                                                 raw_ostream &OS) {
+  OS << formatv("\n{0} {1} ({2}) {0}\n", "--------------------", Title, Count);
+}
+
 // Print the global variables.
 void DetailedRecordsEmitter::printVariables(raw_ostream &OS) {
   const auto GlobalList = Records.getGlobals();
   printSectionHeading("Global Variables", GlobalList.size(), OS);
 
-  OS << NL;
+  OS << "\n";
----------------
s-barannikov wrote:

```suggestion
  OS << '\n';
```

https://github.com/llvm/llvm-project/pull/105770


More information about the llvm-commits mailing list