[PATCH] D36820: [Bash-autocompletion] Add support for -std=
Yuka Takahashi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 17 13:03:43 PDT 2017
yamaguchi updated this revision to Diff 111549.
yamaguchi marked 2 inline comments as done.
yamaguchi added a comment.
Update diff.
https://reviews.llvm.org/D36820
Files:
clang/include/clang/Driver/Options.td
clang/test/Driver/autocomplete.c
llvm/utils/TableGen/OptParserEmitter.cpp
Index: llvm/utils/TableGen/OptParserEmitter.cpp
===================================================================
--- llvm/utils/TableGen/OptParserEmitter.cpp
+++ llvm/utils/TableGen/OptParserEmitter.cpp
@@ -303,14 +303,15 @@
OS << "#ifdef OPTTABLE_ARG_INIT\n";
OS << "//////////\n";
OS << "// Option Values\n\n";
+ OS << "bool ValuesWereAdded;\n";
for (unsigned I = 0, E = Opts.size(); I != E; ++I) {
const Record &R = *Opts[I];
if (!isa<UnsetInit>(R.getValueInit("ValuesCode"))) {
OS << "{\n";
OS << R.getValueAsString("ValuesCode");
OS << "\n";
for (const std::string &Pref : R.getValueAsListOfStrings("Prefixes")) {
- OS << "bool ValuesWereAdded = ";
+ OS << "ValuesWereAdded = ";
OS << "Opt.addValues(";
std::string S = (Pref + R.getValueAsString("Name")).str();
write_cstring(OS, S);
Index: clang/test/Driver/autocomplete.c
===================================================================
--- clang/test/Driver/autocomplete.c
+++ clang/test/Driver/autocomplete.c
@@ -95,3 +95,5 @@
// NOWARNING: -Wno-invalid-pp-token
// RUN: %clang --autocomplete=-analyzer-checker, | FileCheck %s -check-prefix=ANALYZER
// ANALYZER: unix.Malloc
+// RUN: %clang --autocomplete=-std=, | FileCheck %s -check-prefix=STDVAL
+// STDVAL: c99
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -2249,7 +2249,14 @@
def static : Flag<["-", "--"], "static">, Flags<[NoArgumentUnused]>;
def std_default_EQ : Joined<["-"], "std-default=">;
def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option]>,
- Group<CompileOnly_Group>, HelpText<"Language standard to compile for">;
+ Group<CompileOnly_Group>, HelpText<"Language standard to compile for">,
+ ValuesCode<[{
+ const char *Values =
+ #define LANGSTANDARD(id, name, lang, desc, features) name ","
+ #define LANGSTANDARD_ALIAS(id, alias) alias ","
+ #include "clang/Frontend/LangStandards.def"
+ ;
+ }]>;
def stdlib_EQ : Joined<["-", "--"], "stdlib=">, Flags<[CC1Option]>,
HelpText<"C++ standard library to use">, Values<"libc++,libstdc++,platform">;
def sub__library : JoinedOrSeparate<["-"], "sub_library">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36820.111549.patch
Type: text/x-patch
Size: 2318 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170817/0162370f/attachment.bin>
More information about the cfe-commits
mailing list