diff options
author | Craig Topper <craig.topper@sifive.com> | 2024-04-19 12:39:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-19 12:39:54 -0700 |
commit | 8e2060bf210e83d6cc34f61185918ca67b54f6f1 (patch) | |
tree | db53ac9ec9608343d9e36d80bd2f0f542e50ff26 /llvm | |
parent | 016ce9ed5cd3694cbff72a768a593714913822ea (diff) | |
download | llvm-8e2060bf210e83d6cc34f61185918ca67b54f6f1.zip llvm-8e2060bf210e83d6cc34f61185918ca67b54f6f1.tar.gz llvm-8e2060bf210e83d6cc34f61185918ca67b54f6f1.tar.bz2 |
[X86][TableGen] Remove unnecessary use of formatted_raw_ostream. NFC (#89343)
This code used to use the PadToColumn feature of formatted_raw_ostream,
but no longer does. formatted_raw_ostream is slower than regular
raw_ostream because it has to keep track of the number of character
since the last new line character.
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/utils/TableGen/X86FoldTablesEmitter.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/X86FoldTablesEmitter.cpp b/llvm/utils/TableGen/X86FoldTablesEmitter.cpp index 0e36747..1440863 100644 --- a/llvm/utils/TableGen/X86FoldTablesEmitter.cpp +++ b/llvm/utils/TableGen/X86FoldTablesEmitter.cpp @@ -15,7 +15,6 @@ #include "Common/CodeGenTarget.h" #include "X86RecognizableInstr.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/Support/FormattedStream.h" #include "llvm/Support/X86FoldTablesUtils.h" #include "llvm/TableGen/Record.h" #include "llvm/TableGen/TableGenBackend.h" @@ -95,7 +94,7 @@ class X86FoldTablesEmitter { const CodeGenInstruction *MemInst) : RegInst(RegInst), MemInst(MemInst) {} - void print(formatted_raw_ostream &OS) const { + void print(raw_ostream &OS) const { OS.indent(2); OS << "{X86::" << RegInst->TheDef->getName() << ", "; OS << "X86::" << MemInst->TheDef->getName() << ", "; @@ -222,7 +221,7 @@ private: // Print the given table as a static const C++ array of type // X86FoldTableEntry. void printTable(const FoldTable &Table, StringRef TableName, - formatted_raw_ostream &OS) { + raw_ostream &OS) { OS << "static const X86FoldTableEntry " << TableName << "[] = {\n"; for (auto &E : Table) @@ -619,9 +618,7 @@ void X86FoldTablesEmitter::updateTables(const CodeGenInstruction *RegInst, } } -void X86FoldTablesEmitter::run(raw_ostream &O) { - formatted_raw_ostream OS(O); - +void X86FoldTablesEmitter::run(raw_ostream &OS) { // Holds all memory instructions std::vector<const CodeGenInstruction *> MemInsts; // Holds all register instructions - divided according to opcode. |