From c6cae65dd0b015f16024d320fb4ee0ce6891adde Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Fri, 2 Mar 2018 21:53:25 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326623 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 2 +- test/Driver/unknown-arg.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 3dddb02bd0..6925157d2e 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -1764,7 +1764,7 @@ def iwithsysroot : JoinedOrSeparate<["-"], "iwithsysroot">, Group Flags<[CC1Option]>; def ivfsoverlay : JoinedOrSeparate<["-"], "ivfsoverlay">, Group, Flags<[CC1Option]>, HelpText<"Overlay the virtual filesystem described by file over the real file system">; -def i : Joined<["-"], "i">, Group; +def imultilib : Separate<["-"], "imultilib">, Group; def keep__private__externs : Flag<["-"], "keep_private_externs">; def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>, Group; diff --git a/test/Driver/unknown-arg.c b/test/Driver/unknown-arg.c index d6bb5f7ae3..befd0637e0 100644 --- a/test/Driver/unknown-arg.c +++ b/test/Driver/unknown-arg.c @@ -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'? -- 2.40.0