[llvm] b24737d - [NFC][RISCV] use OS.indent() to replace spaces (#102429)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 08:04:42 PDT 2024
Author: Jerry Zhang Jian
Date: 2024-08-08T23:04:39+08:00
New Revision: b24737d3ac522fc4e36d3be5b52ffca9d53e30b5
URL: https://github.com/llvm/llvm-project/commit/b24737d3ac522fc4e36d3be5b52ffca9d53e30b5
DIFF: https://github.com/llvm/llvm-project/commit/b24737d3ac522fc4e36d3be5b52ffca9d53e30b5.diff
LOG: [NFC][RISCV] use OS.indent() to replace spaces (#102429)
Added:
Modified:
llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
Removed:
################################################################################
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