From 8093fefb1e9906a4b3da2e360d21e0f93ee6e752 Mon Sep 17 00:00:00 2001 From: Yuka Takahashi Date: Tue, 29 Aug 2017 02:01:56 +0000 Subject: [PATCH] [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 --- utils/TableGen/OptParserEmitter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/TableGen/OptParserEmitter.cpp b/utils/TableGen/OptParserEmitter.cpp index ce0541d9794..0358cf26509 100644 --- a/utils/TableGen/OptParserEmitter.cpp +++ b/utils/TableGen/OptParserEmitter.cpp @@ -308,11 +308,11 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS) { if (isa(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";