[llvm] f35064d - llvm-tblgen: Move decl of `EmitDecoder()`to TableGenBackends.h

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 00:22:25 PDT 2023


Author: NAKAMURA Takumi
Date: 2023-03-21T16:21:27+09:00
New Revision: f35064dbe993708cad39234ced0b7c4b01c98ae2

URL: https://github.com/llvm/llvm-project/commit/f35064dbe993708cad39234ced0b7c4b01c98ae2
DIFF: https://github.com/llvm/llvm-project/commit/f35064dbe993708cad39234ced0b7c4b01c98ae2.diff

LOG: llvm-tblgen: Move decl of `EmitDecoder()`to TableGenBackends.h

Differential Revision: https://reviews.llvm.org/D144351

Added: 
    

Modified: 
    llvm/utils/TableGen/DecoderEmitter.cpp
    llvm/utils/TableGen/DisassemblerEmitter.cpp
    llvm/utils/TableGen/TableGenBackends.h

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index b3f696654fc5..e1cdbb8aa254 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -15,6 +15,7 @@
 #include "CodeGenInstruction.h"
 #include "CodeGenTarget.h"
 #include "InfoByHwMode.h"
+#include "TableGenBackends.h"
 #include "VarLenCodeEmitterGen.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"

diff  --git a/llvm/utils/TableGen/DisassemblerEmitter.cpp b/llvm/utils/TableGen/DisassemblerEmitter.cpp
index 6280df37db6a..eba6c54bd385 100644
--- a/llvm/utils/TableGen/DisassemblerEmitter.cpp
+++ b/llvm/utils/TableGen/DisassemblerEmitter.cpp
@@ -96,9 +96,6 @@ using namespace llvm::X86Disassembler;
 
 namespace llvm {
 
-extern void EmitDecoder(RecordKeeper &RK, raw_ostream &OS,
-                        const std::string &PredicateNamespace);
-
 void EmitDisassembler(RecordKeeper &Records, raw_ostream &OS) {
   CodeGenTarget Target(Records);
   emitSourceFileHeader(" * " + Target.getName().str() + " Disassembler", OS);

diff  --git a/llvm/utils/TableGen/TableGenBackends.h b/llvm/utils/TableGen/TableGenBackends.h
index 12ea753cf953..7be83af3734f 100644
--- a/llvm/utils/TableGen/TableGenBackends.h
+++ b/llvm/utils/TableGen/TableGenBackends.h
@@ -15,6 +15,8 @@
 #ifndef LLVM_UTILS_TABLEGEN_TABLEGENBACKENDS_H
 #define LLVM_UTILS_TABLEGEN_TABLEGENBACKENDS_H
 
+#include <string>
+
 // A TableGen backend is a function that looks like
 //
 //    EmitFoo(RecordKeeper &RK, raw_ostream &OS /*, anything else you need */ )
@@ -96,6 +98,10 @@ void EmitDirectivesImpl(RecordKeeper &RK, raw_ostream &OS);
 void EmitDXILOperation(RecordKeeper &RK, raw_ostream &OS);
 void EmitRISCVTargetDef(const RecordKeeper &RK, raw_ostream &OS);
 
+// Defined in DecoderEmitter.cpp
+void EmitDecoder(RecordKeeper &RK, raw_ostream &OS,
+                 const std::string &PredicateNamespace);
+
 } // namespace llvm
 
 #endif


        


More information about the llvm-commits mailing list