[llvm] [NFC][RISCV] use OS.indent() to replace spaces (PR #102429)

Jerry Zhang Jian via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 00:32:53 PDT 2024


https://github.com/jerryzj updated https://github.com/llvm/llvm-project/pull/102429

>From c61b7a177df980a62d801a664570bf3bab760724 Mon Sep 17 00:00:00 2001
From: Jerry Zhang Jian <jerry.zhangjian at sifive.com>
Date: Thu, 8 Aug 2024 00:16:19 -0700
Subject: [PATCH] [NFC][RISCV] use OS.indent() to replace spaces

Signed-off-by: Jerry Zhang Jian <jerry.zhangjian at sifive.com>
---
 llvm/utils/TableGen/RISCVTargetDefEmitter.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp b/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
index 910488a14b9858..34f2a85c80d795 100644
--- a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
+++ b/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
@@ -36,7 +36,7 @@ static void printExtensionTable(raw_ostream &OS,
     if (R->getValueAsBit("Experimental") != Experimental)
       continue;
 
-    OS << "    {\"" << getExtensionName(R) << "\", {"
+    OS.indent(4) << "{\"" << getExtensionName(R) << "\", {"
        << R->getValueAsInt("MajorVersion") << ", "
        << R->getValueAsInt("MinorVersion") << "}},\n";
   }
@@ -77,7 +77,7 @@ static void emitRISCVExtensions(RecordKeeper &Records, raw_ostream &OS) {
         if (!ImpliedExt->isSubClassOf("RISCVExtension"))
           continue;
 
-        OS << "    { {\"" << Name << "\"}, \"" << getExtensionName(ImpliedExt)
+        OS.indent(4) << "{ {\"" << Name << "\"}, \"" << getExtensionName(ImpliedExt)
            << "\"},\n";
       }
     }
@@ -236,7 +236,7 @@ static void emitRISCVExtensionBitmask(RecordKeeper &RK, raw_ostream &OS) {
            "duplicated bitmask");
 #endif
 
-    OS << "    {"
+    OS.indent(4) << "{"
        << "\"" << ExtName << "\""
        << ", " << GroupIDVal << ", " << BitPosVal << "ULL"
        << "},\n";



More information about the llvm-commits mailing list