<div dir="ltr">Thank you for your feedback!<div><br></div><div>For options which have `NoDriverOption` Flags (such as -mrelocation-model), I agree that we should expose these flags to users only when `-cc1` is also passed.</div><div><br></div><div>However, as to `-mrelocation-model [tab]`, I think it is fine to provide possible values for this option (static,pic,ropi..) because user has already typed `-mrelocation-model` and maybe already be aware that this is cc1 option.</div><div><br></div><div>I'll create a new patch and send it to review soon :)</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-27 18:32 GMT+09:00 Vassil Vassilev <span dir="ltr"><<a href="mailto:v.g.vassilev@gmail.com" target="_blank">v.g.vassilev@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<div class="m_-8684487796230992838moz-cite-prefix">On 27/06/17 07:17, Saleem Abdulrasool
via cfe-commits wrote:<br>
</div>
<blockquote type="cite">
<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>
</blockquote></span>
Thanks for the feedback!<br>
<br>
We probably should only expose the cc1 options if the user typed
clang -cc1 -f[tab], i.e. the user already is looking for something
internal or make sure they are noted as a cc1 arguments. On the
other hand, this should be of great help to more advanced users.<div><div class="h5"><br>
<blockquote type="cite">
<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-pr<wbr>oject?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/D3455<wbr>8</a><br>
<br>
Modified:<br>
cfe/trunk/include/clang/Driver<wbr>/CC1Options.td<br>
cfe/trunk/test/Driver/autocomp<wbr>lete.c<br>
<br>
Modified: cfe/trunk/include/clang/Driver<wbr>/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-pr<wbr>oject/cfe/trunk/include/clang/<wbr>Driver/CC1Options.td?rev=<wbr>306127&r1=306126&r2=306127&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/include/clang/Driver<wbr>/CC1Options.td
(original)<br>
+++ cfe/trunk/include/clang/Driver<wbr>/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,r<wbr>opi-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,la<wbr>rge">;<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-fallba<wbr>ck,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_l<wbr>ocation :
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,mixe<wbr>d">;<br>
def disable_objc_default_synthesiz<wbr>e_properties :
Flag<["-"], "disable-objc-default-synthesi<wbr>ze-properties">,<br>
HelpText<"disable the default synthesis of Objective-C
properties">;<br>
def fencode_extended_block_signatu<wbr>re : Flag<["-"],
"fencode-extended-block-signat<wbr>ure">,<br>
@@ -673,7 +673,7 @@ def fnative_half_arguments_and_ret<wbr>urns
:<br>
def fallow_half_arguments_and_retu<wbr>rns : Flag<["-"],
"fallow-half-arguments-and-ret<wbr>urns">,<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,stdcall<wbr>,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/autocomp<wbr>lete.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-pr<wbr>oject/cfe/trunk/test/Driver/au<wbr>tocomplete.c?rev=306127&r1=306<wbr>126&r2=306127&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Driver/autocomp<wbr>lete.c (original)<br>
+++ cfe/trunk/test/Driver/autocomp<wbr>lete.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-mo<wbr>del, |
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" target="_blank">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="m_-8684487796230992838gmail_signature" data-smartmail="gmail_signature">Saleem
Abdulrasool<br>
compnerd (at) compnerd (dot) org</div>
</div>
<br>
<fieldset class="m_-8684487796230992838mimeAttachmentHeader"></fieldset>
<br>
<pre>______________________________<wbr>_________________
cfe-commits mailing list
<a class="m_-8684487796230992838moz-txt-link-abbreviated" href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>
<a class="m_-8684487796230992838moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a>
</pre>
</blockquote>
<p><br>
</p>
</div></div></div>
</blockquote></div><br></div>