[clang] [llvm][tblgen] Add `SourcePath` for `emitSourceFileHeader` (PR #65744)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 23 10:04:59 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-llvm

<details>
<summary>Changes</summary>

I think this is very helpful for reading generated `.inc` files.

---

Patch is 31.85 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/65744.diff


22 Files Affected:

- (modified) clang/utils/TableGen/ClangASTNodesEmitter.cpp (+2-2) 
- (modified) clang/utils/TableGen/ClangASTPropertiesEmitter.cpp (+4-4) 
- (modified) clang/utils/TableGen/ClangAttrEmitter.cpp (+28-19) 
- (modified) clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp (+4-4) 
- (modified) clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp (+2-2) 
- (modified) clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp (+2-3) 
- (modified) clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp (+3-3) 
- (modified) clang/utils/TableGen/ClangSyntaxEmitter.cpp (+2-2) 
- (modified) clang/utils/TableGen/ClangTypeNodesEmitter.cpp (+1-1) 
- (modified) lldb/utils/TableGen/LLDBOptionDefEmitter.cpp (+1-1) 
- (modified) lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp (+2-2) 
- (modified) llvm/include/llvm/TableGen/TableGenBackend.h (+3-1) 
- (modified) llvm/lib/TableGen/TableGenBackend.cpp (+6-1) 
- (modified) llvm/utils/TableGen/AsmMatcherEmitter.cpp (+1-1) 
- (modified) llvm/utils/TableGen/AsmWriterEmitter.cpp (+1-1) 
- (modified) llvm/utils/TableGen/VTEmitter.cpp (+1-1) 
- (modified) mlir/tools/mlir-tblgen/DialectGen.cpp (+2-2) 
- (modified) mlir/tools/mlir-tblgen/EnumsGen.cpp (+2-2) 
- (modified) mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp (+1-1) 
- (modified) mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp (+2-2) 
- (modified) mlir/tools/mlir-tblgen/RewriterGen.cpp (+1-1) 
- (modified) mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp (+14-8) 


``````````diff
diff --git a/clang/utils/TableGen/ClangASTNodesEmitter.cpp b/clang/utils/TableGen/ClangASTNodesEmitter.cpp
index 2b8d7a9efdf10c9..16a1c74b9d91ad6 100644
--- a/clang/utils/TableGen/ClangASTNodesEmitter.cpp
+++ b/clang/utils/TableGen/ClangASTNodesEmitter.cpp
@@ -169,7 +169,7 @@ void ClangASTNodesEmitter::deriveChildTree() {
 void ClangASTNodesEmitter::run(raw_ostream &OS) {
   deriveChildTree();
 
-  emitSourceFileHeader("List of AST nodes of a particular kind", OS);
+  emitSourceFileHeader("List of AST nodes of a particular kind", OS, Records);
 
   // Write the preamble
   OS << "#ifndef ABSTRACT_" << macroHierarchyName() << "\n";
@@ -205,7 +205,7 @@ void clang::EmitClangASTNodes(RecordKeeper &RK, raw_ostream &OS,
 void clang::EmitClangDeclContext(RecordKeeper &Records, raw_ostream &OS) {
   // FIXME: Find a .td file format to allow for this to be represented better.
 
-  emitSourceFileHeader("List of AST Decl nodes", OS);
+  emitSourceFileHeader("List of AST Decl nodes", OS, Records);
 
   OS << "#ifndef DECL_CONTEXT\n";
   OS << "#  define DECL_CONTEXT(DECL)\n";
diff --git a/clang/utils/TableGen/ClangASTPropertiesEmitter.cpp b/clang/utils/TableGen/ClangASTPropertiesEmitter.cpp
index 19613880641efe9..de8dda60681ff87 100644
--- a/clang/utils/TableGen/ClangASTPropertiesEmitter.cpp
+++ b/clang/utils/TableGen/ClangASTPropertiesEmitter.cpp
@@ -593,7 +593,7 @@ void ASTPropsEmitter::emitWriteOfProperty(StringRef writerName,
 template <class NodeClass>
 static void emitASTReader(RecordKeeper &records, raw_ostream &out,
                           StringRef description) {
-  emitSourceFileHeader(description, out);
+  emitSourceFileHeader(description, out, records);
 
   ASTPropsEmitter(records, out).emitNodeReaderClass<NodeClass>();
 }
@@ -607,7 +607,7 @@ void clang::EmitClangTypeReader(RecordKeeper &records, raw_ostream &out) {
 template <class NodeClass>
 static void emitASTWriter(RecordKeeper &records, raw_ostream &out,
                           StringRef description) {
-  emitSourceFileHeader(description, out);
+  emitSourceFileHeader(description, out, records);
 
   ASTPropsEmitter(records, out).emitNodeWriterClass<NodeClass>();
 }
@@ -852,7 +852,7 @@ void ASTPropsEmitter::emitBasicReaderWriterFile(const ReaderWriterInfo &info) {
 /// Emit an .inc file that defines some helper classes for reading
 /// basic values.
 void clang::EmitClangBasicReader(RecordKeeper &records, raw_ostream &out) {
-  emitSourceFileHeader("Helper classes for BasicReaders", out);
+  emitSourceFileHeader("Helper classes for BasicReaders", out, records);
 
   // Use any property, we won't be using those properties.
   auto info = ReaderWriterInfo::forReader<TypeNode>();
@@ -862,7 +862,7 @@ void clang::EmitClangBasicReader(RecordKeeper &records, raw_ostream &out) {
 /// Emit an .inc file that defines some helper classes for writing
 /// basic values.
 void clang::EmitClangBasicWriter(RecordKeeper &records, raw_ostream &out) {
-  emitSourceFileHeader("Helper classes for BasicWriters", out);
+  emitSourceFileHeader("Helper classes for BasicWriters", out, records);
 
   // Use any property, we won't be using those properties.
   auto info = ReaderWriterInfo::forWriter<TypeNode>();
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 7ea09058c3d39f2..6ba82a22df1ee3c 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -2921,7 +2921,7 @@ static void emitAttributes(RecordKeeper &Records, raw_ostream &OS,
 }
 // Emits the class definitions for attributes.
 void clang::EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Attribute classes' definitions", OS);
+  emitSourceFileHeader("Attribute classes' definitions", OS, Records);
 
   OS << "#ifndef LLVM_CLANG_ATTR_CLASSES_INC\n";
   OS << "#define LLVM_CLANG_ATTR_CLASSES_INC\n\n";
@@ -2933,7 +2933,8 @@ void clang::EmitClangAttrClass(RecordKeeper &Records, raw_ostream &OS) {
 
 // Emits the class method definitions for attributes.
 void clang::EmitClangAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Attribute classes' member function definitions", OS);
+  emitSourceFileHeader("Attribute classes' member function definitions", OS,
+                       Records);
 
   emitAttributes(Records, OS, false);
 
@@ -3169,7 +3170,8 @@ namespace clang {
 
 // Emits the enumeration list for attributes.
 void EmitClangAttrList(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("List of all attributes that Clang recognizes", OS);
+  emitSourceFileHeader("List of all attributes that Clang recognizes", OS,
+                       Records);
 
   AttrClassHierarchy Hierarchy(Records);
 
@@ -3211,7 +3213,8 @@ void EmitClangAttrList(RecordKeeper &Records, raw_ostream &OS) {
 void EmitClangAttrPrintList(const std::string &FieldName, RecordKeeper &Records,
                             raw_ostream &OS) {
   emitSourceFileHeader(
-      "List of attributes that can be print on the left side of a decl", OS);
+      "List of attributes that can be print on the left side of a decl", OS,
+      Records);
 
   AttrClassHierarchy Hierarchy(Records);
 
@@ -3240,7 +3243,8 @@ void EmitClangAttrPrintList(const std::string &FieldName, RecordKeeper &Records,
 // Emits the enumeration list for attributes.
 void EmitClangAttrSubjectMatchRuleList(RecordKeeper &Records, raw_ostream &OS) {
   emitSourceFileHeader(
-      "List of all attribute subject matching rules that Clang recognizes", OS);
+      "List of all attribute subject matching rules that Clang recognizes", OS,
+      Records);
   PragmaClangAttributeSupport &PragmaAttributeSupport =
       getPragmaAttributeSupport(Records);
   emitDefaultDefine(OS, "ATTR_MATCH_RULE", nullptr);
@@ -3250,7 +3254,7 @@ void EmitClangAttrSubjectMatchRuleList(RecordKeeper &Records, raw_ostream &OS) {
 
 // Emits the code to read an attribute from a precompiled header.
 void EmitClangAttrPCHRead(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Attribute deserialization code", OS);
+  emitSourceFileHeader("Attribute deserialization code", OS, Records);
 
   Record *InhClass = Records.getClass("InheritableAttr");
   std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"),
@@ -3305,7 +3309,7 @@ void EmitClangAttrPCHRead(RecordKeeper &Records, raw_ostream &OS) {
 
 // Emits the code to write an attribute to a precompiled header.
 void EmitClangAttrPCHWrite(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Attribute serialization code", OS);
+  emitSourceFileHeader("Attribute serialization code", OS, Records);
 
   Record *InhClass = Records.getClass("InheritableAttr");
   std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"), Args;
@@ -3506,7 +3510,8 @@ void EmitClangAttrTokenKinds(RecordKeeper &Records, raw_ostream &OS) {
 
 // Emits the list of spellings for attributes.
 void EmitClangAttrHasAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Code to implement the __has_attribute logic", OS);
+  emitSourceFileHeader("Code to implement the __has_attribute logic", OS,
+                       Records);
 
   // Separate all of the attributes out into four group: generic, C++11, GNU,
   // and declspecs. Then generate a big switch statement for each of them.
@@ -3586,8 +3591,9 @@ void EmitClangAttrHasAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
 }
 
 void EmitClangAttrSpellingListIndex(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Code to translate different attribute spellings "
-                       "into internal identifiers", OS);
+  emitSourceFileHeader("Code to translate different attribute spellings into "
+                       "internal identifiers",
+                       OS, Records);
 
   OS << "  switch (getParsedKind()) {\n";
   OS << "    case IgnoredAttribute:\n";
@@ -3617,7 +3623,8 @@ void EmitClangAttrSpellingListIndex(RecordKeeper &Records, raw_ostream &OS) {
 
 // Emits code used by RecursiveASTVisitor to visit attributes
 void EmitClangAttrASTVisitor(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Used by RecursiveASTVisitor to visit attributes.", OS);
+  emitSourceFileHeader("Used by RecursiveASTVisitor to visit attributes.", OS,
+                       Records);
 
   std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr");
 
@@ -3742,7 +3749,8 @@ void EmitClangAttrTemplateInstantiateHelper(const std::vector<Record *> &Attrs,
 
 // Emits code to instantiate dependent attributes on templates.
 void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Template instantiation code for attributes", OS);
+  emitSourceFileHeader("Template instantiation code for attributes", OS,
+                       Records);
 
   std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr");
 
@@ -3764,7 +3772,8 @@ void EmitClangAttrTemplateInstantiate(RecordKeeper &Records, raw_ostream &OS) {
 
 // Emits the list of parsed attributes.
 void EmitClangAttrParsedAttrList(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("List of all attributes that Clang recognizes", OS);
+  emitSourceFileHeader("List of all attributes that Clang recognizes", OS,
+                       Records);
 
   OS << "#ifndef PARSED_ATTR\n";
   OS << "#define PARSED_ATTR(NAME) NAME\n";
@@ -4350,7 +4359,7 @@ static bool IsKnownToGCC(const Record &Attr) {
 
 /// Emits the parsed attribute helpers
 void EmitClangAttrParsedAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Parsed attribute helpers", OS);
+  emitSourceFileHeader("Parsed attribute helpers", OS, Records);
 
   OS << "#if !defined(WANT_DECL_MERGE_LOGIC) && "
      << "!defined(WANT_STMT_MERGE_LOGIC)\n";
@@ -4512,7 +4521,7 @@ void EmitClangAttrParsedAttrImpl(RecordKeeper &Records, raw_ostream &OS) {
 
 // Emits the kind list of parsed attributes
 void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Attribute name matcher", OS);
+  emitSourceFileHeader("Attribute name matcher", OS, Records);
 
   std::vector<Record *> Attrs = Records.getAllDerivedDefinitions("Attr");
   std::vector<StringMatcher::StringPair> GNU, Declspec, Microsoft, CXX11,
@@ -4613,7 +4622,7 @@ void EmitClangAttrParsedAttrKinds(RecordKeeper &Records, raw_ostream &OS) {
 
 // Emits the code to dump an attribute.
 void EmitClangAttrTextNodeDump(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Attribute text node dumper", OS);
+  emitSourceFileHeader("Attribute text node dumper", OS, Records);
 
   std::vector<Record*> Attrs = Records.getAllDerivedDefinitions("Attr"), Args;
   for (const auto *Attr : Attrs) {
@@ -4652,7 +4661,7 @@ void EmitClangAttrTextNodeDump(RecordKeeper &Records, raw_ostream &OS) {
 }
 
 void EmitClangAttrNodeTraverse(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Attribute text node traverser", OS);
+  emitSourceFileHeader("Attribute text node traverser", OS, Records);
 
   std::vector<Record *> Attrs = Records.getAllDerivedDefinitions("Attr"), Args;
   for (const auto *Attr : Attrs) {
@@ -4682,7 +4691,7 @@ void EmitClangAttrNodeTraverse(RecordKeeper &Records, raw_ostream &OS) {
 
 void EmitClangAttrParserStringSwitches(RecordKeeper &Records,
                                        raw_ostream &OS) {
-  emitSourceFileHeader("Parser-related llvm::StringSwitch cases", OS);
+  emitSourceFileHeader("Parser-related llvm::StringSwitch cases", OS, Records);
   emitClangAttrArgContextList(Records, OS);
   emitClangAttrIdentifierArgList(Records, OS);
   emitClangAttrUnevaluatedStringLiteralList(Records, OS);
@@ -4699,7 +4708,7 @@ void EmitClangAttrSubjectMatchRulesParserStringSwitches(RecordKeeper &Records,
 }
 
 void EmitClangAttrDocTable(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Clang attribute documentation", OS);
+  emitSourceFileHeader("Clang attribute documentation", OS, Records);
 
   std::vector<Record *> Attrs = Records.getAllDerivedDefinitions("Attr");
   for (const auto *A : Attrs) {
diff --git a/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp b/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp
index a988a5631acabce..3016c2b0bdbda59 100644
--- a/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp
+++ b/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp
@@ -21,8 +21,8 @@
 using namespace llvm;
 
 void clang::EmitClangCommentCommandInfo(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("A list of commands useable in documentation "
-                       "comments", OS);
+  emitSourceFileHeader("A list of commands useable in documentation comments",
+                       OS, Records);
 
   OS << "namespace {\n"
         "const CommandInfo Commands[] = {\n";
@@ -113,8 +113,8 @@ static std::string MangleName(StringRef Str) {
 }
 
 void clang::EmitClangCommentCommandList(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("A list of commands useable in documentation "
-                       "comments", OS);
+  emitSourceFileHeader("A list of commands useable in documentation comments",
+                       OS, Records);
 
   OS << "#ifndef COMMENT_COMMAND\n"
      << "#  define COMMENT_COMMAND(NAME)\n"
diff --git a/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp b/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
index 15671a99a3fc217..47b871afdeebea7 100644
--- a/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
+++ b/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
@@ -70,8 +70,8 @@ void clang::EmitClangCommentHTMLNamedCharacterReferences(RecordKeeper &Records,
     NameToUTF8.push_back(Match);
   }
 
-  emitSourceFileHeader("HTML named character reference to UTF-8 "
-                       "translation", OS);
+  emitSourceFileHeader("HTML named character reference to UTF-8 translation",
+                       OS, Records);
 
   OS << "StringRef translateHTMLNamedCharacterReferenceToUTF8(\n"
         "                                             StringRef Name) {\n";
diff --git a/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp b/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp
index 78bbbd1cba57668..3dc1098753e0bff 100644
--- a/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp
+++ b/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp
@@ -27,7 +27,7 @@ void clang::EmitClangCommentHTMLTags(RecordKeeper &Records, raw_ostream &OS) {
                          "return true;");
   }
 
-  emitSourceFileHeader("HTML tag name matcher", OS);
+  emitSourceFileHeader("HTML tag name matcher", OS, Records);
 
   OS << "bool isHTMLTagName(StringRef Name) {\n";
   StringMatcher("Name", Matches, OS).Emit();
@@ -49,7 +49,7 @@ void clang::EmitClangCommentHTMLTagsProperties(RecordKeeper &Records,
       MatchesEndTagForbidden.push_back(Match);
   }
 
-  emitSourceFileHeader("HTML tag properties", OS);
+  emitSourceFileHeader("HTML tag properties", OS, Records);
 
   OS << "bool isHTMLEndTagOptional(StringRef Name) {\n";
   StringMatcher("Name", MatchesEndTagOptional, OS).Emit();
@@ -61,4 +61,3 @@ void clang::EmitClangCommentHTMLTagsProperties(RecordKeeper &Records,
   OS << "  return false;\n"
      << "}\n\n";
 }
-
diff --git a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
index 1c3b7e4398a8cd7..968b3e0661a8f33 100644
--- a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -339,7 +339,7 @@ class OpenCLBuiltinHeaderEmitter : public OpenCLBuiltinFileEmitterBase {
 } // namespace
 
 void BuiltinNameEmitter::Emit() {
-  emitSourceFileHeader("OpenCL Builtin handling", OS);
+  emitSourceFileHeader("OpenCL Builtin handling", OS, Records);
 
   OS << "#include \"llvm/ADT/StringRef.h\"\n";
   OS << "using namespace clang;\n\n";
@@ -1215,7 +1215,7 @@ StringRef OpenCLBuiltinFileEmitterBase::emitTypeExtensionGuards(
 }
 
 void OpenCLBuiltinTestEmitter::emit() {
-  emitSourceFileHeader("OpenCL Builtin exhaustive testing", OS);
+  emitSourceFileHeader("OpenCL Builtin exhaustive testing", OS, Records);
 
   emitExtensionSetup();
 
@@ -1273,7 +1273,7 @@ void OpenCLBuiltinTestEmitter::emit() {
 }
 
 void OpenCLBuiltinHeaderEmitter::emit() {
-  emitSourceFileHeader("OpenCL Builtin declarations", OS);
+  emitSourceFileHeader("OpenCL Builtin declarations", OS, Records);
 
   emitExtensionSetup();
 
diff --git a/clang/utils/TableGen/ClangSyntaxEmitter.cpp b/clang/utils/TableGen/ClangSyntaxEmitter.cpp
index a940edbb1d246b7..9720d587318432e 100644
--- a/clang/utils/TableGen/ClangSyntaxEmitter.cpp
+++ b/clang/utils/TableGen/ClangSyntaxEmitter.cpp
@@ -129,7 +129,7 @@ struct SyntaxConstraint {
 
 void clang::EmitClangSyntaxNodeList(llvm::RecordKeeper &Records,
                                     llvm::raw_ostream &OS) {
-  llvm::emitSourceFileHeader("Syntax tree node list", OS);
+  llvm::emitSourceFileHeader("Syntax tree node list", OS, Records);
   Hierarchy H(Records);
   OS << R"cpp(
 #ifndef NODE
@@ -188,7 +188,7 @@ static void printDoc(llvm::StringRef Doc, llvm::raw_ostream &OS) {
 
 void clang::EmitClangSyntaxNodeClasses(llvm::RecordKeeper &Records,
                                        llvm::raw_ostream &OS) {
-  llvm::emitSourceFileHeader("Syntax tree node list", OS);
+  llvm::emitSourceFileHeader("Syntax tree node list", OS, Records);
   Hierarchy H(Records);
 
   OS << "\n// Forward-declare node types so we don't have to carefully "
diff --git a/clang/utils/TableGen/ClangTypeNodesEmitter.cpp b/clang/utils/TableGen/ClangTypeNodesEmitter.cpp
index 690042f3200e860..66bdf5e67602ba2 100644
--- a/clang/utils/TableGen/ClangTypeNodesEmitter.cpp
+++ b/clang/utils/TableGen/ClangTypeNodesEmitter.cpp
@@ -104,7 +104,7 @@ void TypeNodeEmitter::emit() {
   if (Types.empty())
     PrintFatalError("no Type records in input!");
 
-  emitSourceFileHeader("An x-macro database of Clang type nodes", Out);
+  emitSourceFileHeader("An x-macro database of Clang type nodes", Out, Records);
 
   // Preamble
   addMacroToUndef(TypeMacroName);
diff --git a/lldb/utils/TableGen/LLDBOptionDefEmitter.cpp b/lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
index b936b8fd653b304..b48a0e4beda3a9f 100644
--- a/lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
+++ b/lldb/utils/TableGen/LLDBOptionDefEmitter.cpp
@@ -171,7 +171,7 @@ static void emitOptions(std::string Command, std::vector<Record *> Records,
 }
 
 void lldb_private::EmitOptionDefs(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Options for LLDB command line commands.", OS);
+  emitSourceFileHeader("Options for LLDB command line commands.", OS, Records);
 
   std::vector<Record *> Options = Records.getAllDerivedDefinitions("Option");
   for (auto &CommandRecordPair : getRecordsByName(Options, "Command")) {
diff --git a/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp b/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
index e3522f2c7b2d34b..f27f0f39fbfd61d 100644
--- a/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
+++ b/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
@@ -168,7 +168,7 @@ static void emitPropertyEnum(std::string PropertyName,
 }
 
 void lldb_private::EmitPropertyDefs(RecordKeeper &Records, raw_ostream &OS) {
-  emitSourceFileHeader("Property definitions for LLDB.", OS);
+  emitSourceFileHeader("Property definitions for LLDB.", OS, Records);
 
   std::vector<Record *> Properties =
       Records.getAllDerivedDefinitions("Property");
@@ -179,7 +179,7 @@ void lldb_private::EmitPropertyDefs(RecordKeeper &Records, raw_ostream &OS) {
 
 void lldb_private::EmitPropertyEnumDefs(RecordKeeper &Records,
                                         raw_ostream &OS) {
-  emitSourceFileHeader("Property definition enum for LLDB.", OS);
+  emitSourceFileHeader("Property definition enum for LLDB.", OS, Records);
 
   std::vector<Record *> Properties =
       Records.getAllDerivedDefinitions("Property");
diff --git a/llvm/include/llvm/TableGen/TableGenBackend.h b/llvm/include/llvm/TableGen/TableGenBackend.h
index 39f1e14bc950841..9c5a785f45a4039 100644
--- a/llvm/include/llvm/TableGen/TableGenBackend.h
+++ b/llvm/include/llvm/TableGen/TableGenBackend.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/M...
[truncated]

``````````

</details>


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


More information about the cfe-commits mailing list