forked from OSchip/llvm-project
GCC compatibility: Ignore -finput_charset=UTF-8 argument. It is the default in Clang.
Currently, we fail with an error. Reviewers: rafael Reviewed By: rafael Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D4347 llvm-svn: 212110
This commit is contained in:
parent
f575a73751
commit
91f380a499
|
@ -559,6 +559,7 @@ def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>;
|
|||
def : Flag<["-"], "findirect-virtual-calls">, Alias<fapple_kext>;
|
||||
def finline_functions : Flag<["-"], "finline-functions">, Group<clang_ignored_f_Group>;
|
||||
def finline : Flag<["-"], "finline">, Group<clang_ignored_f_Group>;
|
||||
def finput_charset_EQ : Joined<["-"], "finput-charset=">, Group<f_Group>;
|
||||
def finstrument_functions : Flag<["-"], "finstrument-functions">, Group<f_Group>, Flags<[CC1Option]>,
|
||||
HelpText<"Generate calls to instrument function entry and exit">;
|
||||
def : Flag<["-"], "fkeep-inline-functions">, Group<clang_ignored_f_Group>;
|
||||
|
|
|
@ -3911,6 +3911,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
D.Diag(diag::err_drv_clang_unsupported)
|
||||
<< Args.getLastArg(options::OPT_fno_for_scope)->getAsString(Args);
|
||||
|
||||
// -finput_charset=UTF-8 is default. Reject others
|
||||
if (Arg *inputCharset = Args.getLastArg(
|
||||
options::OPT_finput_charset_EQ)) {
|
||||
StringRef value = inputCharset->getValue();
|
||||
if (value != "UTF-8")
|
||||
D.Diag(diag::err_drv_invalid_value) << inputCharset->getAsString(Args) << value;
|
||||
}
|
||||
|
||||
// -fcaret-diagnostics is default.
|
||||
if (!Args.hasFlag(options::OPT_fcaret_diagnostics,
|
||||
options::OPT_fno_caret_diagnostics, true))
|
||||
|
|
|
@ -129,6 +129,9 @@
|
|||
// RUN: %clang -S -O20 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-O %s
|
||||
// CHECK-INVALID-O: warning: optimization level '-O20' is unsupported; using '-O3' instead
|
||||
|
||||
// RUN: %clang -### -S -finput-charset=iso-8859-1 -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-INVALID-CHARSET %s
|
||||
// CHECK-INVALID-CHARSET: error: invalid value 'iso-8859-1' in '-finput-charset=iso-8859-1'
|
||||
|
||||
// Test that we don't error on these.
|
||||
// RUN: %clang -### -S -Werror \
|
||||
// RUN: -falign-functions -falign-functions=2 -fno-align-functions \
|
||||
|
@ -140,6 +143,7 @@
|
|||
// RUN: -fgcse -fno-gcse \
|
||||
// RUN: -fident -fno-ident \
|
||||
// RUN: -fimplicit-templates -fno-implicit-templates \
|
||||
// RUN: -finput-charset=UTF-8 \
|
||||
// RUN: -fivopts -fno-ivopts \
|
||||
// RUN: -fnon-call-exceptions -fno-non-call-exceptions \
|
||||
// RUN: -fpermissive -fno-permissive \
|
||||
|
|
Loading…
Reference in New Issue