-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[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
Conversation
Rename OptXXXEmitter.cpp to OptionXXXEmitter.cpp to have a less ambiguious name, as `Opt` could also mean optimization.
@@ -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, |
There was a problem hiding this comment.
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.
Friendly ping @kazutakahirata and @topperc |
@llvm/pr-subscribers-tablegen Author: Rahul Joshi (jurahul) ChangesRename OptXXXEmitter.cpp to OptionXXXEmitter.cpp to have a less ambiguous Full diff: https://github.com/llvm/llvm-project/pull/109216.diff 6 Files Affected:
diff --git a/llvm/include/llvm/Option/OptTable.h b/llvm/include/llvm/Option/OptTable.h
index d8bf292bac21aa..8fabc78d81aedf 100644
--- a/llvm/include/llvm/Option/OptTable.h
+++ b/llvm/include/llvm/Option/OptTable.h
@@ -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*/>
diff --git a/llvm/unittests/Option/OptionMarshallingTest.cpp b/llvm/unittests/Option/OptionMarshallingTest.cpp
index 0464e27d5248a8..2ec422f1a09843 100644
--- a/llvm/unittests/Option/OptionMarshallingTest.cpp
+++ b/llvm/unittests/Option/OptionMarshallingTest.cpp
@@ -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.
diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt
index abebb98761d06e..ba1e4aa01b48d6 100644
--- a/llvm/utils/TableGen/CMakeLists.txt
+++ b/llvm/utils/TableGen/CMakeLists.txt
@@ -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
diff --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptionParserEmitter.cpp
similarity index 98%
rename from llvm/utils/TableGen/OptParserEmitter.cpp
rename to llvm/utils/TableGen/OptionParserEmitter.cpp
index 79cbf51514ae5c..5ae6f773a3c603 100644
--- a/llvm/utils/TableGen/OptParserEmitter.cpp
+++ b/llvm/utils/TableGen/OptionParserEmitter.cpp
@@ -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.
@@ -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");
@@ -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");
diff --git a/llvm/utils/TableGen/OptRSTEmitter.cpp b/llvm/utils/TableGen/OptionRSTEmitter.cpp
similarity index 89%
rename from llvm/utils/TableGen/OptRSTEmitter.cpp
rename to llvm/utils/TableGen/OptionRSTEmitter.cpp
index 16125198a7c387..b798896a80963e 100644
--- a/llvm/utils/TableGen/OptRSTEmitter.cpp
+++ b/llvm/utils/TableGen/OptionRSTEmitter.cpp
@@ -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.
@@ -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;
@@ -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");
diff --git a/llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn b/llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn
index 2e11d25767cd00..e93250d7f0b7c4 100644
--- a/llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn
@@ -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",
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/146/builds/1231 Here is the relevant piece of the build log for the reference
|
Rename OptXXXEmitter.cpp to OptionXXXEmitter.cpp to have a less ambiguous
name, as
Opt
could also mean optimization.