[llvm] 730bbc6 - [llvm/OptTable] Drop "The" prefix on fields
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 27 08:26:49 PDT 2021
Author: Nico Weber
Date: 2021-09-27T11:24:51-04:00
New Revision: 730bbc6f72e3f28a657aeeabe3e9219af10fb473
URL: https://github.com/llvm/llvm-project/commit/730bbc6f72e3f28a657aeeabe3e9219af10fb473
DIFF: https://github.com/llvm/llvm-project/commit/730bbc6f72e3f28a657aeeabe3e9219af10fb473.diff
LOG: [llvm/OptTable] Drop "The" prefix on fields
Added:
Modified:
llvm/include/llvm/Option/OptTable.h
llvm/lib/Option/OptTable.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Option/OptTable.h b/llvm/include/llvm/Option/OptTable.h
index 4388e7efc8ae..07d9870f71b3 100644
--- a/llvm/include/llvm/Option/OptTable.h
+++ b/llvm/include/llvm/Option/OptTable.h
@@ -64,8 +64,8 @@ class OptTable {
bool GroupedShortOptions = false;
const char *EnvVar = nullptr;
- unsigned TheInputOptionID = 0;
- unsigned TheUnknownOptionID = 0;
+ unsigned InputOptionID = 0;
+ unsigned UnknownOptionID = 0;
/// The index of the first option which can be parsed (i.e., is not a
/// special option like 'input' or 'unknown', and is not an option group).
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index 405e18e2c2fd..deaea9b60f29 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -104,11 +104,11 @@ OptTable::OptTable(ArrayRef<Info> OptionInfos, bool IgnoreCase)
for (unsigned i = 0, e = getNumOptions(); i != e; ++i) {
unsigned Kind = getInfo(i + 1).Kind;
if (Kind == Option::InputClass) {
- assert(!TheInputOptionID && "Cannot have multiple input options!");
- TheInputOptionID = getInfo(i + 1).ID;
+ assert(!InputOptionID && "Cannot have multiple input options!");
+ InputOptionID = getInfo(i + 1).ID;
} else if (Kind == Option::UnknownClass) {
- assert(!TheUnknownOptionID && "Cannot have multiple unknown options!");
- TheUnknownOptionID = getInfo(i + 1).ID;
+ assert(!UnknownOptionID && "Cannot have multiple unknown options!");
+ UnknownOptionID = getInfo(i + 1).ID;
} else if (Kind != Option::GroupClass) {
FirstSearchableIndex = i;
break;
@@ -344,8 +344,7 @@ std::unique_ptr<Arg> OptTable::parseOneArgGrouped(InputArgList &Args,
const char *CStr = Args.getArgString(Index);
StringRef Str(CStr);
if (isInput(PrefixesUnion, Str))
- return std::make_unique<Arg>(getOption(TheInputOptionID), Str, Index++,
- CStr);
+ return std::make_unique<Arg>(getOption(InputOptionID), Str, Index++, CStr);
const Info *End = OptionInfos.data() + OptionInfos.size();
StringRef Name = Str.ltrim(PrefixChars);
@@ -379,7 +378,7 @@ std::unique_ptr<Arg> OptTable::parseOneArgGrouped(InputArgList &Args,
Option Opt(Fallback, this);
// Check that the last option isn't a flag wrongly given an argument.
if (Str[2] == '=')
- return std::make_unique<Arg>(getOption(TheUnknownOptionID), Str, Index++,
+ return std::make_unique<Arg>(getOption(UnknownOptionID), Str, Index++,
CStr);
if (std::unique_ptr<Arg> A =
@@ -394,12 +393,10 @@ std::unique_ptr<Arg> OptTable::parseOneArgGrouped(InputArgList &Args,
if (Str[1] != '-') {
CStr = Args.MakeArgString(Str.substr(0, 2));
Args.replaceArgString(Index, Twine('-') + Str.substr(2));
- return std::make_unique<Arg>(getOption(TheUnknownOptionID), CStr, Index,
- CStr);
+ return std::make_unique<Arg>(getOption(UnknownOptionID), CStr, Index, CStr);
}
- return std::make_unique<Arg>(getOption(TheUnknownOptionID), Str, Index++,
- CStr);
+ return std::make_unique<Arg>(getOption(UnknownOptionID), Str, Index++, CStr);
}
std::unique_ptr<Arg> OptTable::ParseOneArg(const ArgList &Args, unsigned &Index,
@@ -411,8 +408,7 @@ std::unique_ptr<Arg> OptTable::ParseOneArg(const ArgList &Args, unsigned &Index,
// Anything that doesn't start with PrefixesUnion is an input, as is '-'
// itself.
if (isInput(PrefixesUnion, Str))
- return std::make_unique<Arg>(getOption(TheInputOptionID), Str, Index++,
- Str);
+ return std::make_unique<Arg>(getOption(InputOptionID), Str, Index++, Str);
const Info *Start = OptionInfos.data() + FirstSearchableIndex;
const Info *End = OptionInfos.data() + OptionInfos.size();
@@ -458,11 +454,9 @@ std::unique_ptr<Arg> OptTable::ParseOneArg(const ArgList &Args, unsigned &Index,
// If we failed to find an option and this arg started with /, then it's
// probably an input path.
if (Str[0] == '/')
- return std::make_unique<Arg>(getOption(TheInputOptionID), Str, Index++,
- Str);
+ return std::make_unique<Arg>(getOption(InputOptionID), Str, Index++, Str);
- return std::make_unique<Arg>(getOption(TheUnknownOptionID), Str, Index++,
- Str);
+ return std::make_unique<Arg>(getOption(UnknownOptionID), Str, Index++, Str);
}
InputArgList OptTable::ParseArgs(ArrayRef<const char *> ArgArr,
More information about the llvm-commits
mailing list