diff options
author | Yuka Takahashi <yukatkh@gmail.com> | 2017-06-20 16:31:31 +0000 |
---|---|---|
committer | Yuka Takahashi <yukatkh@gmail.com> | 2017-06-20 16:31:31 +0000 |
commit | ba5d4af49096fa863f04736c5b0f54ff54a23905 (patch) | |
tree | f501ba91ae7394ac04304a26cb42abfef13078e7 /llvm/utils/TableGen/OptParserEmitter.cpp | |
parent | 7f5313cb9f41f5c0dabfb19c2cc82089189d3bec (diff) | |
download | bcm5719-llvm-ba5d4af49096fa863f04736c5b0f54ff54a23905.tar.gz bcm5719-llvm-ba5d4af49096fa863f04736c5b0f54ff54a23905.zip |
[GSoC] Flag value completion for clang
This is patch for GSoC project, bash-completion for clang.
To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
bash-autocomplete.sh is code for bash-completion.
In this patch, Options.td was mainly changed in order to add value class
in Options.inc.
llvm-svn: 305805
Diffstat (limited to 'llvm/utils/TableGen/OptParserEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/OptParserEmitter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp index 04e6537f3d1..e3777d036a2 100644 --- a/llvm/utils/TableGen/OptParserEmitter.cpp +++ b/llvm/utils/TableGen/OptParserEmitter.cpp @@ -196,6 +196,9 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS) { OS << ", nullptr"; // The option meta-variable name (unused). + OS << ", nullptr"; + + // The option Values (unused for groups). OS << ", nullptr)\n"; } OS << "\n"; @@ -285,6 +288,13 @@ void EmitOptParser(RecordKeeper &Records, raw_ostream &OS) { else OS << "nullptr"; + // The option Values. Used for shell autocompletion. + OS << ", "; + if (!isa<UnsetInit>(R.getValueInit("Values"))) + write_cstring(OS, R.getValueAsString("Values")); + else + OS << "nullptr"; + OS << ")\n"; } OS << "#endif // OPTION\n"; |