From 06205ca78ca2fd4384b237f120ec66614df0d9fc Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 15 Oct 2010 22:30:42 +0000 Subject: [PATCH] Driver: Error on -fno-for-scope, which we have no intention of supporting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116627 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 4 ++++ lib/Driver/Tools.cpp | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index ab87d57d43..fea77725a6 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -275,6 +275,10 @@ def fextdirs_EQ : Joined<"-fextdirs=">, Group; def fhosted : Flag<"-fhosted">, Group; def ffast_math : Flag<"-ffast-math">, Group; def ffinite_math_only : Flag<"-ffinite-math-only">, Group; + +def ffor_scope : Flag<"-ffor-scope">, Group; +def fno_for_scope : Flag<"-fno-for-scope">, Group; + def ffreestanding : Flag<"-ffreestanding">, Group; def fgnu_keywords : Flag<"-fgnu-keywords">, Group; def fgnu_runtime : Flag<"-fgnu-runtime">, Group; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 229cf608f3..8bce56636a 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1406,12 +1406,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fno-common"); // -fsigned-bitfields is default, and clang doesn't yet support - // --funsigned-bitfields. + // -funsigned-bitfields. if (!Args.hasFlag(options::OPT_fsigned_bitfields, options::OPT_funsigned_bitfields)) D.Diag(clang::diag::warn_drv_clang_unsupported) << Args.getLastArg(options::OPT_funsigned_bitfields)->getAsString(Args); + // -fsigned-bitfields is default, and clang doesn't support -fno-for-scope. + if (!Args.hasFlag(options::OPT_ffor_scope, + options::OPT_fno_for_scope)) + D.Diag(clang::diag::err_drv_clang_unsupported) + << Args.getLastArg(options::OPT_fno_for_scope)->getAsString(Args); + // -fcaret-diagnostics is default. if (!Args.hasFlag(options::OPT_fcaret_diagnostics, options::OPT_fno_caret_diagnostics, true)) -- 2.40.0