projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09e3404
)
[NFC] First test commit
author
Jan Svoboda
<jan_svoboda@apple.com>
Wed, 11 Nov 2020 09:20:11 +0000
(10:20 +0100)
committer
Jan Svoboda
<jan_svoboda@apple.com>
Wed, 11 Nov 2020 09:20:11 +0000
(10:20 +0100)
llvm/utils/TableGen/OptParserEmitter.cpp
patch
|
blob
|
history
diff --git
a/llvm/utils/TableGen/OptParserEmitter.cpp
b/llvm/utils/TableGen/OptParserEmitter.cpp
index
0c30a2d
..
d791bd8
100644
(file)
--- 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();
}