[Bash-autocompletion] Auto complete cc1 options if -cc1 is specified
authorYuka Takahashi <yukatkh@gmail.com>
Sat, 8 Jul 2017 17:48:59 +0000 (17:48 +0000)
committerYuka Takahashi <yukatkh@gmail.com>
Sat, 8 Jul 2017 17:48:59 +0000 (17:48 +0000)
commit33cf63b7f26946e6f14878ad9400f4e77f723f0f
tree6389be627ed50ecba138b75f4f60d485a981e333
parent15309d1ce1fb1c0934a56d35fdaeaf5b5b088b34
[Bash-autocompletion] Auto complete cc1 options if -cc1 is specified

Summary:
We don't want to autocomplete flags whose Flags class has `NoDriverOption` when argv[1] is not `-cc1`.

Another idea for this implementation is to make --autocomplete a cc1
option and handle it in clang Frontend, by porting --autocomplete
handler from Driver to Frontend, so that we can handle Driver options
and CC1 options in unified manner.

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

llvm-svn: 307479
clang/lib/Driver/Driver.cpp
clang/test/Driver/autocomplete.c
clang/utils/bash-autocomplete.sh
llvm/include/llvm/Option/OptTable.h
llvm/lib/Option/OptTable.cpp