Skip to content

[LLVM][TableGen] Rename Option emitter files #109216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/Option/OptTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class OptTable {
// the program, HelpText is used instead. This cannot use std::vector
// because OptTable is used in constexpr contexts. Increase the array sizes
// here if you need more entries and adjust the constants in
// OptParserEmitter::EmitHelpTextsForVariants.
// OptionParserEmitter::EmitHelpTextsForVariants.
std::array<std::pair<std::array<unsigned int, 2 /*MaxVisibilityPerHelp*/>,
const char *>,
1 /*MaxVisibilityHelp*/>
Expand Down
2 changes: 1 addition & 1 deletion llvm/unittests/Option/OptionMarshallingTest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- unittest/Support/OptionMarshallingTest.cpp - OptParserEmitter tests ===//
//===- OptionMarshallingTest.cpp - OptionParserEmitter tests -================//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down
4 changes: 2 additions & 2 deletions llvm/utils/TableGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ add_tablegen(llvm-tblgen LLVM
InstrInfoEmitter.cpp
IntrinsicEmitter.cpp
MacroFusionPredicatorEmitter.cpp
OptParserEmitter.cpp
OptRSTEmitter.cpp
OptionParserEmitter.cpp
OptionRSTEmitter.cpp
PseudoLoweringEmitter.cpp
RegisterBankEmitter.cpp
RegisterInfoEmitter.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- OptParserEmitter.cpp - Table Driven Command Line Parsing -----------===//
//===- OptionParserEmitter.cpp - Table Driven Command Option Line Parsing -===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand Down Expand Up @@ -247,10 +247,10 @@ static void EmitHelpTextsForVariants(
OS << " }})";
}

/// OptParserEmitter - This tablegen backend takes an input .td file
/// OptionParserEmitter - This tablegen backend takes an input .td file
/// describing a list of options and emits a data structure for parsing and
/// working with those options when given an input command line.
static void EmitOptParser(const RecordKeeper &Records, raw_ostream &OS) {
static void EmitOptionParser(const RecordKeeper &Records, raw_ostream &OS) {
// Get the option groups and options.
ArrayRef<const Record *> Groups =
Records.getAllDerivedDefinitions("OptionGroup");
Expand Down Expand Up @@ -572,5 +572,5 @@ static void EmitOptParser(const RecordKeeper &Records, raw_ostream &OS) {
OS << "\n";
}

static TableGen::Emitter::Opt X("gen-opt-parser-defs", EmitOptParser,
static TableGen::Emitter::Opt X("gen-opt-parser-defs", EmitOptionParser,
"Generate option definitions");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not renaming the option yet as that can cause lot of changes potentially. I could look into allowing register an alias of the option in the TG backend, but not sure if it's worth it.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- OptParserEmitter.cpp - Table Driven Command Line Parsing -----------===//
//===- OptionRSTEmitter.cpp - Table Driven Command Line Option Parsing ----===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -14,9 +14,9 @@

using namespace llvm;

/// OptParserEmitter - This tablegen backend takes an input .td file
/// describing a list of options and emits a RST man page.
static void EmitOptRST(const RecordKeeper &Records, raw_ostream &OS) {
/// This tablegen backend takes an input .td file describing a list of options
/// and emits a RST man page.
static void EmitOptionRST(const RecordKeeper &Records, raw_ostream &OS) {
llvm::StringMap<std::vector<const Record *>> OptionsByGroup;
std::vector<Record *> OptionsWithoutGroup;

Expand Down Expand Up @@ -97,5 +97,5 @@ static void EmitOptRST(const RecordKeeper &Records, raw_ostream &OS) {
}
}

static TableGen::Emitter::Opt X("gen-opt-rst", EmitOptRST,
static TableGen::Emitter::Opt X("gen-opt-rst", EmitOptionRST,
"Generate option RST");
4 changes: 2 additions & 2 deletions llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ executable("llvm-tblgen") {
"InstrDocsEmitter.cpp",
"InstrInfoEmitter.cpp",
"MacroFusionPredicatorEmitter.cpp",
"OptParserEmitter.cpp",
"OptRSTEmitter.cpp",
"OptionParserEmitter.cpp",
"OptionRSTEmitter.cpp",
"PseudoLoweringEmitter.cpp",
"RegisterBankEmitter.cpp",
"RegisterInfoEmitter.cpp",
Expand Down
Loading