[Bash-autocompletion] Add support for -std=

Summary:
Add support for autocompleting values of -std= by including
LangStandards.def. This patch relies on D36782, and is using two-stage
code generation.

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D36820

llvm-svn: 311971
This commit is contained in:
Yuka Takahashi 2017-08-29 02:01:56 +00:00
parent d941a2d8b8
commit 8093fefb1e

View File

@ -308,11 +308,11 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS) {
if (isa<UnsetInit>(R.getValueInit("ValuesCode")))
continue;
OS << "{\n";
OS << "bool ValuesWereAdded;\n";
OS << R.getValueAsString("ValuesCode");
OS << "\n";
for (const std::string &Pref : R.getValueAsListOfStrings("Prefixes")) {
OS << "bool ValuesWereAdded = ";
OS << "Opt.addValues(";
OS << "ValuesWereAdded = Opt.addValues(";
std::string S = (Pref + R.getValueAsString("Name")).str();
write_cstring(OS, S);
OS << ", Values);\n";