Author: erichkeane Date: Fri Mar 2 13:53:25 2018 New Revision: 326623 URL: http://llvm.org/viewvc/llvm-project?rev=326623&view=rev Log: Remove -i command line option, add -imultilib
I discovered that '-i' is a command line option for the driver, however it actually does not do anything and is not supported by any other compiler. In fact, it is completely undocumented for Clang. I found a couple of instances of people confusing it with one of the variety of other command line options that control the driver. Because of this, we should delete this option so that it is clear that it isn't valid. HOWEVER, I found that GCC DOES support -imultilib, which the -i was hiding our lack of support for. We currently only use imultilib for the purpose of forwarding to gfortran (in a specific test written by chandlerc for this purpose). imultilib is a rarely used (if ever?) feature that I could find no references to on the internet, and in fact, my company's massive test suite has zero references to it ever being used. SO, this patch removes the -i option so that we will now give an error on its usage (so that it won't be confused with -I), and replaces it with -imultilib, which is now specified as a gfortran_group option. Differential Revision: https://reviews.llvm.org/D44032 Modified: cfe/trunk/include/clang/Driver/Options.td cfe/trunk/test/Driver/unknown-arg.c Modified: cfe/trunk/include/clang/Driver/Options.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=326623&r1=326622&r2=326623&view=diff ============================================================================== --- cfe/trunk/include/clang/Driver/Options.td (original) +++ cfe/trunk/include/clang/Driver/Options.td Fri Mar 2 13:53:25 2018 @@ -1764,7 +1764,7 @@ def iwithsysroot : JoinedOrSeparate<["-" Flags<[CC1Option]>; def ivfsoverlay : JoinedOrSeparate<["-"], "ivfsoverlay">, Group<clang_i_Group>, Flags<[CC1Option]>, HelpText<"Overlay the virtual filesystem described by file over the real file system">; -def i : Joined<["-"], "i">, Group<i_Group>; +def imultilib : Separate<["-"], "imultilib">, Group<gfortran_Group>; def keep__private__externs : Flag<["-"], "keep_private_externs">; def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>, Group<Link_Group>; Modified: cfe/trunk/test/Driver/unknown-arg.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/unknown-arg.c?rev=326623&r1=326622&r2=326623&view=diff ============================================================================== --- cfe/trunk/test/Driver/unknown-arg.c (original) +++ cfe/trunk/test/Driver/unknown-arg.c Fri Mar 2 13:53:25 2018 @@ -1,5 +1,7 @@ -// RUN: not %clang %s -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -### 2>&1 | \ +// RUN: not %clang %s -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -ifoo -imultilib dir -### 2>&1 | \ // RUN: FileCheck %s +// RUN: %clang %s -imultilib dir -### 2>&1 | \ +// RUN: FileCheck %s --check-prefix=MULTILIB // RUN: not %clang %s -stdlibs=foo -hell -version -### 2>&1 | \ // RUN: FileCheck %s --check-prefix=DID-YOU-MEAN // RUN: %clang_cl -cake-is-lie -%0 -%d -HHHH -munknown-to-clang-option -print-stats -funknown-to-clang-option -### -c -- %s 2>&1 | \ @@ -24,6 +26,8 @@ // CHECK: error: unknown argument: '-munknown-to-clang-option' // CHECK: error: unknown argument: '-print-stats' // CHECK: error: unknown argument: '-funknown-to-clang-option' +// CHECK: error: unknown argument: '-ifoo' +// MULTILIB: warning: argument unused during compilation: '-imultilib dir' // DID-YOU-MEAN: error: unknown argument '-stdlibs=foo', did you mean '-stdlib=foo'? // DID-YOU-MEAN: error: unknown argument '-hell', did you mean '-help'? // DID-YOU-MEAN: error: unknown argument '-version', did you mean '--version'? _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits