[llvm] a20b04c - [NFC] First test commit
Jan Svoboda via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 01:20:35 PST 2020
Author: Jan Svoboda
Date: 2020-11-11T10:20:11+01:00
New Revision: a20b04c984f142d07098ccbc6ea7f73776b20fc6
URL: https://github.com/llvm/llvm-project/commit/a20b04c984f142d07098ccbc6ea7f73776b20fc6
DIFF: https://github.com/llvm/llvm-project/commit/a20b04c984f142d07098ccbc6ea7f73776b20fc6.diff
LOG: [NFC] First test commit
Added:
Modified:
llvm/utils/TableGen/OptParserEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp
index 0c30a2dd28dc..d791bd8032c2 100644
--- a/llvm/utils/TableGen/OptParserEmitter.cpp
+++ b/llvm/utils/TableGen/OptParserEmitter.cpp
@@ -39,10 +39,12 @@ static const std::string getOptionSpelling(const Record &R,
size_t &PrefixLength) {
std::vector<StringRef> Prefixes = R.getValueAsListOfStrings("Prefixes");
StringRef Name = R.getValueAsString("Name");
+
if (Prefixes.empty()) {
PrefixLength = 0;
return Name.str();
}
+
PrefixLength = Prefixes[0].size();
return (Twine(Prefixes[0]) + Twine(Name)).str();
}
More information about the llvm-commits
mailing list