<div dir="ltr">I think that we shouldn't be providing completion for `-cc1` options.  `-cc1as` options are fine as the IAS serves as a replacement for the traditional unix `as`.  But, the `NoDriverOption` values shouldn't be exposed to users.  They are internal details, with no compatibility.  If users start using those options, it makes it harder to prevent command line incompatibilities.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 23, 2017 at 10:05 AM, Yuka Takahashi via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: yamaguchi<br>
Date: Fri Jun 23 12:05:50 2017<br>
New Revision: 306127<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=306127&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=306127&view=rev</a><br>
Log:<br>
[GSoC] Add support for CC1 options.<br>
<br>
Summary:<br>
Add value completion support for options which are defined in<br>
CC1Options.td, because we only handled options in Options.td.<br>
<br>
Reviewers: ruiu, v.g.vassilev, teemperor<br>
<br>
Subscribers: llvm-commits<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D34558" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D34558</a><br>
<br>
Modified:<br>
    cfe/trunk/include/clang/<wbr>Driver/CC1Options.td<br>
    cfe/trunk/test/Driver/<wbr>autocomplete.c<br>
<br>
Modified: cfe/trunk/include/clang/<wbr>Driver/CC1Options.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=306127&r1=306126&r2=306127&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/include/<wbr>clang/Driver/CC1Options.td?<wbr>rev=306127&r1=306126&r2=<wbr>306127&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/include/clang/<wbr>Driver/CC1Options.td (original)<br>
+++ cfe/trunk/include/clang/<wbr>Driver/CC1Options.td Fri Jun 23 12:05:50 2017<br>
@@ -158,7 +158,7 @@ def msave_temp_labels : Flag<["-"], "msa<br>
            "Note this may change .s semantics and shouldn't generally be used "<br>
            "on compiler-generated code.">;<br>
 def mrelocation_model : Separate<["-"], "mrelocation-model">,<br>
-  HelpText<"The relocation model to use">;<br>
+  HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,<wbr>ropi-rwpi,dynamic-no-pic">;<br>
 def fno_math_builtin : Flag<["-"], "fno-math-builtin">,<br>
   HelpText<"Disable implicit builtin knowledge of math functions">;<br>
 }<br>
@@ -229,7 +229,7 @@ def no_struct_path_tbaa : Flag<["-"], "n<br>
 def masm_verbose : Flag<["-"], "masm-verbose">,<br>
   HelpText<"Generate verbose assembly output">;<br>
 def mcode_model : Separate<["-"], "mcode-model">,<br>
-  HelpText<"The code model to use">;<br>
+  HelpText<"The code model to use">, Values<"small,kernel,medium,<wbr>large">;<br>
 def mdebug_pass : Separate<["-"], "mdebug-pass">,<br>
   HelpText<"Enable additional debug output">;<br>
 def mdisable_fp_elim : Flag<["-"], "mdisable-fp-elim">,<br>
@@ -308,7 +308,7 @@ def fsanitize_coverage_no_prune<br>
       HelpText<"Disable coverage pruning (i.e. instrument all blocks/edges)">;<br>
 def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,<br>
     HelpText<"Enable PGO instrumentation. The accepted value is clang, llvm, "<br>
-             "or none">;<br>
+             "or none">, Values<"none,clang,llvm">;<br>
 def fprofile_instrument_path_EQ : Joined<["-"], "fprofile-instrument-path=">,<br>
     HelpText<"Generate instrumented code to collect execution counts into "<br>
              "<file> (overridden by LLVM_PROFILE_FILE env var)">;<br>
@@ -348,9 +348,9 @@ def diagnostic_serialized_file : Separat<br>
   HelpText<"File for serializing diagnostics in a binary format">;<br>
<br>
 def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">,<br>
-  HelpText<"Change diagnostic formatting to match IDE and command line tools">;<br>
+  HelpText<"Change diagnostic formatting to match IDE and command line tools">, Values<"clang,msvc,msvc-<wbr>fallback,vi">;<br>
 def fdiagnostics_show_category : Separate<["-"], "fdiagnostics-show-category">,<br>
-  HelpText<"Print diagnostic category">;<br>
+  HelpText<"Print diagnostic category">, Values<"none,id,name">;<br>
 def fno_diagnostics_use_presumed_<wbr>location : Flag<["-"], "fno-diagnostics-use-presumed-<wbr>location">,<br>
   HelpText<"Ignore #line directives when displaying diagnostic locations">;<br>
 def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">,<br>
@@ -595,11 +595,11 @@ def fconstant_string_class : Separate<["<br>
   MetaVarName<"<class name>">,<br>
   HelpText<"Specify the class to use for constant Objective-C string objects.">;<br>
 def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">,<br>
-  HelpText<"Objective-C++ Automatic Reference Counting standard library kind">;<br>
+  HelpText<"Objective-C++ Automatic Reference Counting standard library kind">, Values<"libc++,libstdc++,none"<wbr>>;<br>
 def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">,<br>
   HelpText<"The target Objective-C runtime supports ARC weak operations">;<br>
 def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">,<br>
-  HelpText<"Objective-C dispatch method to use">;<br>
+  HelpText<"Objective-C dispatch method to use">, Values<"legacy,non-legacy,<wbr>mixed">;<br>
 def disable_objc_default_<wbr>synthesize_properties : Flag<["-"], "disable-objc-default-<wbr>synthesize-properties">,<br>
   HelpText<"disable the default synthesis of Objective-C properties">;<br>
 def fencode_extended_block_<wbr>signature : Flag<["-"], "fencode-extended-block-<wbr>signature">,<br>
@@ -673,7 +673,7 @@ def fnative_half_arguments_and_<wbr>returns :<br>
 def fallow_half_arguments_and_<wbr>returns : Flag<["-"], "fallow-half-arguments-and-<wbr>returns">,<br>
   HelpText<"Allow function arguments and returns of type half">;<br>
 def fdefault_calling_conv_EQ : Joined<["-"], "fdefault-calling-conv=">,<br>
-  HelpText<"Set default MS calling convention">;<br>
+  HelpText<"Set default MS calling convention">, Values<"cdecl,fastcall,<wbr>stdcall,vectorcall">;<br>
 def finclude_default_header : Flag<["-"], "finclude-default-header">,<br>
   HelpText<"Include the default header file for OpenCL">;<br>
 def fpreserve_vec3_type : Flag<["-"], "fpreserve-vec3-type">,<br>
<br>
Modified: cfe/trunk/test/Driver/<wbr>autocomplete.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/autocomplete.c?rev=306127&r1=306126&r2=306127&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/Driver/<wbr>autocomplete.c?rev=306127&r1=<wbr>306126&r2=306127&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Driver/<wbr>autocomplete.c (original)<br>
+++ cfe/trunk/test/Driver/<wbr>autocomplete.c Fri Jun 23 12:05:50 2017<br>
@@ -34,3 +34,5 @@<br>
 // MFLOATABIALL: hard soft softfp<br>
 // RUN: %clang --autocomplete=-mthread-model, | FileCheck %s -check-prefix=MTHREADMODELALL<br>
 // MTHREADMODELALL: posix single<br>
+// RUN: %clang --autocomplete=-mrelocation-<wbr>model, | FileCheck %s -check-prefix=MRELOCMODELALL<br>
+// MRELOCMODELALL: dynamic-no-pic pic ropi ropi-rwpi rwpi static<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div>