diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-07-14 21:58:17 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-07-14 21:58:17 +0000 |
commit | ceb5c5b7f67a30fae305d1d19b478b623e4fbced (patch) | |
tree | c52144b5ddbdab18a1ba6b465e181ecd33fba056 | |
parent | 6dba432c7b862c2219e5d6e52b0cd188fbf84b01 (diff) |
Remove -ftraditional option, which gcc doesn't actually support. Make
using -traditional and -traditional-cpp with clang an error because
it's unsupported in clang and causes a significant change in the
semantics of the language.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75690 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Driver/Options.def | 1 | ||||
-rw-r--r-- | lib/Driver/Tools.cpp | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def index 216f188522..dbc4e34d97 100644 --- a/include/clang/Driver/Options.def +++ b/include/clang/Driver/Options.def @@ -459,7 +459,6 @@ OPTION("-fsyntax-only", fsyntax_only, Flag, INVALID, INVALID, "d", 0, 0, 0) OPTION("-ftemplate-depth-", ftemplate_depth_, Joined, f_Group, INVALID, "", 0, 0, 0) OPTION("-fterminated-vtables", fterminated_vtables, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-ftime-report", ftime_report, Flag, f_Group, INVALID, "", 0, 0, 0) -OPTION("-ftraditional", ftraditional, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-ftrapv", ftrapv, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-funit-at-a-time", funit_at_a_time, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-funsigned-bitfields", funsigned_bitfields, Flag, f_Group, INVALID, "", 0, 0, 0) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index f7f2b190c8..2fe2aa1896 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -597,7 +597,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (A->getOption().matches(options::OPT_fno_unit_at_a_time)) D.Diag(clang::diag::err_drv_clang_unsupported) << A->getAsString(Args); } - + + if (Arg *A = Args.getLastArg(options::OPT_traditional, + options::OPT_traditional_cpp)) + D.Diag(clang::diag::err_drv_clang_unsupported) << A->getAsString(Args); + Args.AddLastArg(CmdArgs, options::OPT_dM); Args.AddLastArg(CmdArgs, options::OPT_dD); @@ -1114,7 +1118,6 @@ void darwin::Preprocess::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-E"); if (Args.hasArg(options::OPT_traditional) || - Args.hasArg(options::OPT_ftraditional) || Args.hasArg(options::OPT_traditional_cpp)) CmdArgs.push_back("-traditional-cpp"); @@ -1153,8 +1156,7 @@ void darwin::Compile::ConstructJob(Compilation &C, const JobAction &JA, types::ID InputType = Inputs[0].getType(); const Arg *A; - if ((A = Args.getLastArg(options::OPT_traditional)) || - (A = Args.getLastArg(options::OPT_ftraditional))) + if ((A = Args.getLastArg(options::OPT_traditional))) D.Diag(clang::diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-E"; |