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

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 00:28:11 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Jerry Zhang Jian (jerryzj)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/102429.diff


1 Files Affected:

- (modified) llvm/utils/TableGen/RISCVTargetDefEmitter.cpp (+3-3) 


``````````diff
diff --git a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp b/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
index 910488a14b985..34f2a85c80d79 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";

``````````

</details>


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


More information about the llvm-commits mailing list