diff options
Diffstat (limited to 'contrib/llvm-project/llvm/utils/TableGen/CodeGenMapTable.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/utils/TableGen/CodeGenMapTable.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/llvm-project/llvm/utils/TableGen/CodeGenMapTable.cpp b/contrib/llvm-project/llvm/utils/TableGen/CodeGenMapTable.cpp index 6f718acbac3e..38871eb8cf3c 100644 --- a/contrib/llvm-project/llvm/utils/TableGen/CodeGenMapTable.cpp +++ b/contrib/llvm-project/llvm/utils/TableGen/CodeGenMapTable.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// CodeGenMapTable provides functionality for the TabelGen to create +// CodeGenMapTable provides functionality for the TableGen to create // relation mapping between instructions. Relation models are defined using // InstrMapping as a base class. This file implements the functionality which // parses these definitions and generates relation maps using the information @@ -443,14 +443,16 @@ void MapTableEmitter::emitMapFuncBody(raw_ostream &OS, if (ValueCols.size() > 1) { for (unsigned i = 0, e = ValueCols.size(); i < e; i++) { ListInit *ColumnI = ValueCols[i]; + OS << " if ("; for (unsigned j = 0, ColSize = ColumnI->size(); j < ColSize; ++j) { std::string ColName = ColFields->getElement(j)->getAsUnquotedString(); - OS << " if (in" << ColName; + OS << "in" << ColName; OS << " == "; OS << ColName << "_" << ColumnI->getElement(j)->getAsUnquotedString(); - if (j < ColumnI->size() - 1) OS << " && "; - else OS << ")\n"; + if (j < ColumnI->size() - 1) + OS << " && "; } + OS << ")\n"; OS << " return " << InstrMapDesc.getName(); OS << "Table[mid]["<<i+1<<"];\n"; } @@ -480,9 +482,10 @@ void MapTableEmitter::emitTablesWithFunc(raw_ostream &OS) { if (ValueCols.size() > 1) { for (Init *CF : ColFields->getValues()) { std::string ColName = CF->getAsUnquotedString(); - OS << ", enum " << ColName << " in" << ColName << ") {\n"; + OS << ", enum " << ColName << " in" << ColName; } - } else { OS << ") {\n"; } + } + OS << ") {\n"; // Emit map table. unsigned TableSize = emitBinSearchTable(OS); |