[llvm-branch-commits] [llvm] 164bcbd - [TableGen] NFC: Rename variables in OptParserEmitter
Jan Svoboda via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Dec 21 03:41:10 PST 2020
Author: Jan Svoboda
Date: 2020-12-21T12:36:46+01:00
New Revision: 164bcbd40e6d10cd8a01477e2e9029b955fea93b
URL: https://github.com/llvm/llvm-project/commit/164bcbd40e6d10cd8a01477e2e9029b955fea93b
DIFF: https://github.com/llvm/llvm-project/commit/164bcbd40e6d10cd8a01477e2e9029b955fea93b.diff
LOG: [TableGen] NFC: Rename variables in OptParserEmitter
Switch to the LLVM naming convention.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93527
Added:
Modified:
llvm/utils/TableGen/OptParserEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp
index 794485256d50..a08a837e5e70 100644
--- a/llvm/utils/TableGen/OptParserEmitter.cpp
+++ b/llvm/utils/TableGen/OptParserEmitter.cpp
@@ -220,11 +220,11 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS) {
Prefixes.insert(std::make_pair(PrefixKeyT(), "prefix_0"));
unsigned CurPrefix = 0;
for (const Record &R : llvm::make_pointee_range(Opts)) {
- std::vector<StringRef> prf = R.getValueAsListOfStrings("Prefixes");
- PrefixKeyT prfkey(prf.begin(), prf.end());
+ std::vector<StringRef> RPrefixes = R.getValueAsListOfStrings("Prefixes");
+ PrefixKeyT PrefixKey(RPrefixes.begin(), RPrefixes.end());
unsigned NewPrefix = CurPrefix + 1;
- if (Prefixes.insert(std::make_pair(prfkey, (Twine("prefix_") +
- Twine(NewPrefix)).str())).second)
+ std::string Prefix = (Twine("prefix_") + Twine(NewPrefix)).str();
+ if (Prefixes.insert(std::make_pair(PrefixKey, Prefix)).second)
CurPrefix = NewPrefix;
}
@@ -299,8 +299,8 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS) {
auto WriteOptRecordFields = [&](raw_ostream &OS, const Record &R) {
// The option prefix;
- std::vector<StringRef> prf = R.getValueAsListOfStrings("Prefixes");
- OS << Prefixes[PrefixKeyT(prf.begin(), prf.end())] << ", ";
+ std::vector<StringRef> RPrefixes = R.getValueAsListOfStrings("Prefixes");
+ OS << Prefixes[PrefixKeyT(RPrefixes.begin(), RPrefixes.end())] << ", ";
// The option string.
emitNameUsingSpelling(OS, R);
More information about the llvm-branch-commits
mailing list