[llvm] [RFC][TableGen] Restructure TableGen Source (PR #80847)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 00:52:08 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff b9079baaddfed5e604fbfaa1d81a7a1c38e78c26 21d4383d1ceabe361369308b438e586902f0e6c8 -- llvm/unittests/TableGen/CodeExpanderTest.cpp llvm/utils/TableGen/AsmMatcherEmitter.cpp llvm/utils/TableGen/AsmWriterEmitter.cpp llvm/utils/TableGen/CallingConvEmitter.cpp llvm/utils/TableGen/CodeEmitterGen.cpp llvm/utils/TableGen/CodeGenMapTable.cpp llvm/utils/TableGen/CompressInstEmitter.cpp llvm/utils/TableGen/DAGISelEmitter.cpp llvm/utils/TableGen/DAGISelMatcherEmitter.cpp llvm/utils/TableGen/DAGISelMatcherGen.cpp llvm/utils/TableGen/DAGISelMatcherOpt.cpp llvm/utils/TableGen/DFAEmitter.cpp llvm/utils/TableGen/DFAPacketizerEmitter.cpp llvm/utils/TableGen/DXILEmitter.cpp llvm/utils/TableGen/DecoderEmitter.cpp llvm/utils/TableGen/DisassemblerEmitter.cpp llvm/utils/TableGen/FastISelEmitter.cpp llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp llvm/utils/TableGen/GlobalISelEmitter.cpp llvm/utils/TableGen/InstrDocsEmitter.cpp llvm/utils/TableGen/InstrInfoEmitter.cpp llvm/utils/TableGen/IntrinsicEmitter.cpp llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp llvm/utils/TableGen/OptParserEmitter.cpp llvm/utils/TableGen/OptRSTEmitter.cpp llvm/utils/TableGen/PseudoLoweringEmitter.cpp llvm/utils/TableGen/RegisterBankEmitter.cpp llvm/utils/TableGen/RegisterInfoEmitter.cpp llvm/utils/TableGen/SearchableTableEmitter.cpp llvm/utils/TableGen/SubtargetEmitter.cpp llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.cpp llvm/utils/TableGen/X86CompressEVEXTablesEmitter.cpp llvm/utils/TableGen/X86FoldTablesEmitter.cpp llvm/utils/TableGen/X86MnemonicTables.cpp llvm/utils/TableGen/X86RecognizableInstr.h llvm/utils/TableGen/Basic/CodeGenIntrinsics.cpp llvm/utils/TableGen/Basic/CodeGenIntrinsics.h llvm/utils/TableGen/Basic/SDNodeProperties.cpp llvm/utils/TableGen/Basic/SDNodeProperties.h llvm/utils/TableGen/Basic/SequenceToOffsetTable.h llvm/utils/TableGen/Common/AsmWriterInst.cpp llvm/utils/TableGen/Common/AsmWriterInst.h llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp llvm/utils/TableGen/Common/CodeGenDAGPatterns.h llvm/utils/TableGen/Common/CodeGenHwModes.cpp llvm/utils/TableGen/Common/CodeGenHwModes.h llvm/utils/TableGen/Common/CodeGenInstAlias.cpp llvm/utils/TableGen/Common/CodeGenInstAlias.h llvm/utils/TableGen/Common/CodeGenInstruction.cpp llvm/utils/TableGen/Common/CodeGenInstruction.h llvm/utils/TableGen/Common/CodeGenRegisters.cpp llvm/utils/TableGen/Common/CodeGenRegisters.h llvm/utils/TableGen/Common/CodeGenSchedule.cpp llvm/utils/TableGen/Common/CodeGenSchedule.h llvm/utils/TableGen/Common/CodeGenTarget.cpp llvm/utils/TableGen/Common/CodeGenTarget.h llvm/utils/TableGen/Common/DAGISelMatcher.cpp llvm/utils/TableGen/Common/DAGISelMatcher.h llvm/utils/TableGen/Common/GlobalISel/CXXPredicates.cpp llvm/utils/TableGen/Common/GlobalISel/CXXPredicates.h llvm/utils/TableGen/Common/GlobalISel/CodeExpander.cpp llvm/utils/TableGen/Common/GlobalISel/CodeExpander.h llvm/utils/TableGen/Common/GlobalISel/CodeExpansions.h llvm/utils/TableGen/Common/GlobalISel/CombinerUtils.h llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTableExecutorEmitter.cpp llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTableExecutorEmitter.h llvm/utils/TableGen/Common/GlobalISel/MatchDataInfo.cpp llvm/utils/TableGen/Common/GlobalISel/MatchDataInfo.h llvm/utils/TableGen/Common/GlobalISel/Patterns.cpp llvm/utils/TableGen/Common/GlobalISel/Patterns.h llvm/utils/TableGen/Common/InfoByHwMode.cpp llvm/utils/TableGen/Common/InfoByHwMode.h llvm/utils/TableGen/Common/OptEmitter.cpp llvm/utils/TableGen/Common/OptEmitter.h llvm/utils/TableGen/Common/PredicateExpander.cpp llvm/utils/TableGen/Common/PredicateExpander.h llvm/utils/TableGen/Common/SubtargetFeatureInfo.cpp llvm/utils/TableGen/Common/SubtargetFeatureInfo.h llvm/utils/TableGen/Common/Types.cpp llvm/utils/TableGen/Common/Types.h llvm/utils/TableGen/Common/VarLenCodeEmitterGen.cpp llvm/utils/TableGen/Common/VarLenCodeEmitterGen.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/utils/TableGen/Common/CodeGenTarget.h b/llvm/utils/TableGen/Common/CodeGenTarget.h
index 6ed69a17ab..90ffd2cfb1 100644
--- a/llvm/utils/TableGen/Common/CodeGenTarget.h
+++ b/llvm/utils/TableGen/Common/CodeGenTarget.h
@@ -16,10 +16,10 @@
 #ifndef LLVM_UTILS_TABLEGEN_CODEGENTARGET_H
 #define LLVM_UTILS_TABLEGEN_CODEGENTARGET_H
 
+#include "Basic/SDNodeProperties.h"
 #include "CodeGenHwModes.h"
 #include "CodeGenInstruction.h"
 #include "InfoByHwMode.h"
-#include "Basic/SDNodeProperties.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
diff --git a/llvm/utils/TableGen/SearchableTableEmitter.cpp b/llvm/utils/TableGen/SearchableTableEmitter.cpp
index a92ea45c24..ddea4684cf 100644
--- a/llvm/utils/TableGen/SearchableTableEmitter.cpp
+++ b/llvm/utils/TableGen/SearchableTableEmitter.cpp
@@ -723,8 +723,10 @@ void SearchableTableEmitter::run(raw_ostream &OS) {
     for (const auto &FieldName : Fields) {
       Table->Fields.emplace_back(FieldName); // Construct a GenericField.
 
-      if (auto TypeOfRecordVal = TableRec->getValue(("TypeOf_" + FieldName).str())) {
-        if (!parseFieldType(Table->Fields.back(), TypeOfRecordVal->getValue())) {
+      if (auto TypeOfRecordVal =
+              TableRec->getValue(("TypeOf_" + FieldName).str())) {
+        if (!parseFieldType(Table->Fields.back(),
+                            TypeOfRecordVal->getValue())) {
           PrintError(TypeOfRecordVal,
                      Twine("Table '") + Table->Name + "' has invalid 'TypeOf_" +
                          FieldName +

``````````

</details>


https://github.com/llvm/llvm-project/pull/80847


More information about the llvm-commits mailing list