diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /clang/utils/TableGen/ClangOptionDocEmitter.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'clang/utils/TableGen/ClangOptionDocEmitter.cpp')
-rw-r--r-- | clang/utils/TableGen/ClangOptionDocEmitter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/utils/TableGen/ClangOptionDocEmitter.cpp b/clang/utils/TableGen/ClangOptionDocEmitter.cpp index b944ad9608f5e..23aa31cc732fb 100644 --- a/clang/utils/TableGen/ClangOptionDocEmitter.cpp +++ b/clang/utils/TableGen/ClangOptionDocEmitter.cpp @@ -48,7 +48,7 @@ Documentation extractDocumentation(RecordKeeper &Records) { std::map<std::string, Record*> OptionsByName; for (Record *R : Records.getAllDerivedDefinitions("Option")) - OptionsByName[R->getValueAsString("Name")] = R; + OptionsByName[std::string(R->getValueAsString("Name"))] = R; auto Flatten = [](Record *R) { return R->getValue("DocFlatten") && R->getValueAsBit("DocFlatten"); @@ -81,7 +81,7 @@ Documentation extractDocumentation(RecordKeeper &Records) { } // Pretend no-X and Xno-Y options are aliases of X and XY. - std::string Name = R->getValueAsString("Name"); + std::string Name = std::string(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); @@ -223,7 +223,7 @@ std::string getRSTStringWithTextFallback(const Record *R, StringRef Primary, return Field == Primary ? Value.str() : escapeRST(Value); } } - return StringRef(); + return std::string(StringRef()); } void emitOptionWithArgs(StringRef Prefix, const Record *Option, @@ -247,7 +247,7 @@ void emitOptionName(StringRef Prefix, const Record *Option, raw_ostream &OS) { std::vector<std::string> Args; if (HasMetaVarName) - Args.push_back(Option->getValueAsString("MetaVarName")); + Args.push_back(std::string(Option->getValueAsString("MetaVarName"))); else if (NumArgs == 1) Args.push_back("<arg>"); @@ -316,8 +316,8 @@ void emitOption(const DocumentedOption &Option, const Record *DocInfo, std::vector<std::string> SphinxOptionIDs; forEachOptionName(Option, DocInfo, [&](const Record *Option) { for (auto &Prefix : Option->getValueAsListOfStrings("Prefixes")) - SphinxOptionIDs.push_back( - getSphinxOptionID((Prefix + Option->getValueAsString("Name")).str())); + SphinxOptionIDs.push_back(std::string(getSphinxOptionID( + (Prefix + Option->getValueAsString("Name")).str()))); }); assert(!SphinxOptionIDs.empty() && "no flags for option"); static std::map<std::string, int> NextSuffix; |