[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:40:02 PDT 2024
https://github.com/jerryzj updated https://github.com/llvm/llvm-project/pull/102429
>From 8ed42bb1f8c6918a88e38576f78f80fb02995dff 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 | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp b/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
index 910488a14b9858..ae5ce32d617b47 100644
--- a/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
+++ b/llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
@@ -36,9 +36,9 @@ static void printExtensionTable(raw_ostream &OS,
if (R->getValueAsBit("Experimental") != Experimental)
continue;
- OS << " {\"" << getExtensionName(R) << "\", {"
- << R->getValueAsInt("MajorVersion") << ", "
- << R->getValueAsInt("MinorVersion") << "}},\n";
+ OS.indent(4) << "{\"" << getExtensionName(R) << "\", {"
+ << R->getValueAsInt("MajorVersion") << ", "
+ << R->getValueAsInt("MinorVersion") << "}},\n";
}
OS << "};\n\n";
@@ -77,8 +77,8 @@ static void emitRISCVExtensions(RecordKeeper &Records, raw_ostream &OS) {
if (!ImpliedExt->isSubClassOf("RISCVExtension"))
continue;
- OS << " { {\"" << Name << "\"}, \"" << getExtensionName(ImpliedExt)
- << "\"},\n";
+ OS.indent(4) << "{ {\"" << Name << "\"}, \""
+ << getExtensionName(ImpliedExt) << "\"},\n";
}
}
@@ -236,10 +236,10 @@ static void emitRISCVExtensionBitmask(RecordKeeper &RK, raw_ostream &OS) {
"duplicated bitmask");
#endif
- OS << " {"
- << "\"" << ExtName << "\""
- << ", " << GroupIDVal << ", " << BitPosVal << "ULL"
- << "},\n";
+ OS.indent(4) << "{"
+ << "\"" << ExtName << "\""
+ << ", " << GroupIDVal << ", " << BitPosVal << "ULL"
+ << "},\n";
}
OS << "};\n";
OS << "#endif\n";
More information about the llvm-commits
mailing list