aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/ClangOptionDocEmitter.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-01 20:58:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-01 20:58:49 +0000
commit416ada0f75bab22b084a1776deb229cd4a669c4d (patch)
tree6eb65f3790434471361628af6199b07a4de92de7 /utils/TableGen/ClangOptionDocEmitter.cpp
parent550ae89a710bf458d47e5b1d183f5e7039c2b384 (diff)
downloadsrc-416ada0f75bab22b084a1776deb229cd4a669c4d.tar.gz
src-416ada0f75bab22b084a1776deb229cd4a669c4d.zip
Vendor import of clang trunk r304460:vendor/clang/clang-trunk-r304460
Notes
Notes: svn path=/vendor/clang/dist/; revision=319463 svn path=/vendor/clang/clang-trunk-r304460/; revision=319464; tag=vendor/clang/clang-trunk-r304460
Diffstat (limited to 'utils/TableGen/ClangOptionDocEmitter.cpp')
-rw-r--r--utils/TableGen/ClangOptionDocEmitter.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/utils/TableGen/ClangOptionDocEmitter.cpp b/utils/TableGen/ClangOptionDocEmitter.cpp
index aa7502e2c850..59314510e0ad 100644
--- a/utils/TableGen/ClangOptionDocEmitter.cpp
+++ b/utils/TableGen/ClangOptionDocEmitter.cpp
@@ -83,7 +83,7 @@ Documentation extractDocumentation(RecordKeeper &Records) {
}
// Pretend no-X and Xno-Y options are aliases of X and XY.
- auto Name = R->getValueAsString("Name");
+ std::string Name = R->getValueAsString("Name");
if (Name.size() >= 4) {
if (Name.substr(0, 3) == "no-" && OptionsByName[Name.substr(3)]) {
Aliases[OptionsByName[Name.substr(3)]].push_back(R);
@@ -229,7 +229,7 @@ std::string getRSTStringWithTextFallback(const Record *R, StringRef Primary,
}
void emitOptionWithArgs(StringRef Prefix, const Record *Option,
- ArrayRef<std::string> Args, raw_ostream &OS) {
+ ArrayRef<StringRef> Args, raw_ostream &OS) {
OS << Prefix << escapeRST(Option->getValueAsString("Name"));
std::pair<StringRef, StringRef> Separators =
@@ -261,14 +261,15 @@ void emitOptionName(StringRef Prefix, const Record *Option, raw_ostream &OS) {
}
}
- emitOptionWithArgs(Prefix, Option, Args, OS);
+ emitOptionWithArgs(Prefix, Option, std::vector<StringRef>(Args.begin(), Args.end()), OS);
auto AliasArgs = Option->getValueAsListOfStrings("AliasArgs");
if (!AliasArgs.empty()) {
Record *Alias = Option->getValueAsDef("Alias");
OS << " (equivalent to ";
- emitOptionWithArgs(Alias->getValueAsListOfStrings("Prefixes").front(),
- Alias, Option->getValueAsListOfStrings("AliasArgs"), OS);
+ emitOptionWithArgs(
+ Alias->getValueAsListOfStrings("Prefixes").front(), Alias,
+ AliasArgs, OS);
OS << ")";
}
}
@@ -310,7 +311,7 @@ void emitOption(const DocumentedOption &Option, const Record *DocInfo,
forEachOptionName(Option, DocInfo, [&](const Record *Option) {
for (auto &Prefix : Option->getValueAsListOfStrings("Prefixes"))
SphinxOptionIDs.push_back(
- getSphinxOptionID(Prefix + Option->getValueAsString("Name")));
+ getSphinxOptionID((Prefix + Option->getValueAsString("Name")).str()));
});
assert(!SphinxOptionIDs.empty() && "no flags for option");
static std::map<std::string, int> NextSuffix;