Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

jerryzj
Copy link
Contributor

@jerryzj jerryzj commented Aug 8, 2024

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Aug 8, 2024

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

Author: Jerry Zhang Jian (jerryzj)

Changes

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

1 Files Affected:

  • (modified) llvm/utils/TableGen/RISCVTargetDefEmitter.cpp (+3-3)
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";

@jerryzj jerryzj changed the title [RISCV][NFC] use OS.indent() to replace spaces [NFC][RISCV] use OS.indent() to replace spaces Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Collaborator

@topperc topperc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jerryzj jerryzj merged commit b24737d into llvm:main Aug 8, 2024
7 checks passed
@jerryzj jerryzj deleted the dev/os-indent branch August 8, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants