Thank you for your feedback! 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.
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. I'll create a new patch and send it to review soon :) 2017-06-27 18:32 GMT+09:00 Vassil Vassilev <v.g.vassi...@gmail.com>: > On 27/06/17 07:17, Saleem Abdulrasool via cfe-commits wrote: > > 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. > > Thanks for the feedback! > > 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. > > > On Fri, Jun 23, 2017 at 10:05 AM, Yuka Takahashi via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: yamaguchi >> Date: Fri Jun 23 12:05:50 2017 >> New Revision: 306127 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=306127&view=rev >> Log: >> [GSoC] Add support for CC1 options. >> >> Summary: >> Add value completion support for options which are defined in >> CC1Options.td, because we only handled options in Options.td. >> >> Reviewers: ruiu, v.g.vassilev, teemperor >> >> Subscribers: llvm-commits >> >> Differential Revision: https://reviews.llvm.org/D34558 >> >> Modified: >> cfe/trunk/include/clang/Driver/CC1Options.td >> cfe/trunk/test/Driver/autocomplete.c >> >> Modified: cfe/trunk/include/clang/Driver/CC1Options.td >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ >> Driver/CC1Options.td?rev=306127&r1=306126&r2=306127&view=diff >> ============================================================ >> ================== >> --- cfe/trunk/include/clang/Driver/CC1Options.td (original) >> +++ cfe/trunk/include/clang/Driver/CC1Options.td Fri Jun 23 12:05:50 2017 >> @@ -158,7 +158,7 @@ def msave_temp_labels : Flag<["-"], "msa >> "Note this may change .s semantics and shouldn't generally be >> used " >> "on compiler-generated code.">; >> def mrelocation_model : Separate<["-"], "mrelocation-model">, >> - HelpText<"The relocation model to use">; >> + HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,r >> opi-rwpi,dynamic-no-pic">; >> def fno_math_builtin : Flag<["-"], "fno-math-builtin">, >> HelpText<"Disable implicit builtin knowledge of math functions">; >> } >> @@ -229,7 +229,7 @@ def no_struct_path_tbaa : Flag<["-"], "n >> def masm_verbose : Flag<["-"], "masm-verbose">, >> HelpText<"Generate verbose assembly output">; >> def mcode_model : Separate<["-"], "mcode-model">, >> - HelpText<"The code model to use">; >> + HelpText<"The code model to use">, Values<"small,kernel,medium,la >> rge">; >> def mdebug_pass : Separate<["-"], "mdebug-pass">, >> HelpText<"Enable additional debug output">; >> def mdisable_fp_elim : Flag<["-"], "mdisable-fp-elim">, >> @@ -308,7 +308,7 @@ def fsanitize_coverage_no_prune >> HelpText<"Disable coverage pruning (i.e. instrument all >> blocks/edges)">; >> def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">, >> HelpText<"Enable PGO instrumentation. The accepted value is clang, >> llvm, " >> - "or none">; >> + "or none">, Values<"none,clang,llvm">; >> def fprofile_instrument_path_EQ : Joined<["-"], >> "fprofile-instrument-path=">, >> HelpText<"Generate instrumented code to collect execution counts >> into " >> "<file> (overridden by LLVM_PROFILE_FILE env var)">; >> @@ -348,9 +348,9 @@ def diagnostic_serialized_file : Separat >> HelpText<"File for serializing diagnostics in a binary format">; >> >> def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">, >> - HelpText<"Change diagnostic formatting to match IDE and command line >> tools">; >> + HelpText<"Change diagnostic formatting to match IDE and command line >> tools">, Values<"clang,msvc,msvc-fallback,vi">; >> def fdiagnostics_show_category : Separate<["-"], >> "fdiagnostics-show-category">, >> - HelpText<"Print diagnostic category">; >> + HelpText<"Print diagnostic category">, Values<"none,id,name">; >> def fno_diagnostics_use_presumed_location : Flag<["-"], >> "fno-diagnostics-use-presumed-location">, >> HelpText<"Ignore #line directives when displaying diagnostic >> locations">; >> def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">, >> @@ -595,11 +595,11 @@ def fconstant_string_class : Separate<[" >> MetaVarName<"<class name>">, >> HelpText<"Specify the class to use for constant Objective-C string >> objects.">; >> def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">, >> - HelpText<"Objective-C++ Automatic Reference Counting standard library >> kind">; >> + HelpText<"Objective-C++ Automatic Reference Counting standard library >> kind">, Values<"libc++,libstdc++,none">; >> def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">, >> HelpText<"The target Objective-C runtime supports ARC weak >> operations">; >> def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">, >> - HelpText<"Objective-C dispatch method to use">; >> + HelpText<"Objective-C dispatch method to use">, >> Values<"legacy,non-legacy,mixed">; >> def disable_objc_default_synthesize_properties : Flag<["-"], >> "disable-objc-default-synthesize-properties">, >> HelpText<"disable the default synthesis of Objective-C properties">; >> def fencode_extended_block_signature : Flag<["-"], >> "fencode-extended-block-signature">, >> @@ -673,7 +673,7 @@ def fnative_half_arguments_and_returns : >> def fallow_half_arguments_and_returns : Flag<["-"], >> "fallow-half-arguments-and-returns">, >> HelpText<"Allow function arguments and returns of type half">; >> def fdefault_calling_conv_EQ : Joined<["-"], "fdefault-calling-conv=">, >> - HelpText<"Set default MS calling convention">; >> + HelpText<"Set default MS calling convention">, >> Values<"cdecl,fastcall,stdcall,vectorcall">; >> def finclude_default_header : Flag<["-"], "finclude-default-header">, >> HelpText<"Include the default header file for OpenCL">; >> def fpreserve_vec3_type : Flag<["-"], "fpreserve-vec3-type">, >> >> Modified: cfe/trunk/test/Driver/autocomplete.c >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/au >> tocomplete.c?rev=306127&r1=306126&r2=306127&view=diff >> ============================================================ >> ================== >> --- cfe/trunk/test/Driver/autocomplete.c (original) >> +++ cfe/trunk/test/Driver/autocomplete.c Fri Jun 23 12:05:50 2017 >> @@ -34,3 +34,5 @@ >> // MFLOATABIALL: hard soft softfp >> // RUN: %clang --autocomplete=-mthread-model, | FileCheck %s >> -check-prefix=MTHREADMODELALL >> // MTHREADMODELALL: posix single >> +// RUN: %clang --autocomplete=-mrelocation-model, | FileCheck %s >> -check-prefix=MRELOCMODELALL >> +// MRELOCMODELALL: dynamic-no-pic pic ropi ropi-rwpi rwpi static >> >> >> _______________________________________________ >> cfe-commits mailing list >> cfe-commits@lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >> > > > > -- > Saleem Abdulrasool > compnerd (at) compnerd (dot) org > > > _______________________________________________ > cfe-commits mailing > listcfe-comm...@lists.llvm.orghttp://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits > > >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits