From f8c247d247f9f7ab2bf4965677e6d056711c99d5 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 23 Apr 2011 19:48:40 +0000 Subject: Move all of the logic for __DEPRECATED to the driver based on comments from dgregor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130066 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/Driver/Tools.cpp') diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index f5dacfa6cf..2e74e272cb 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1363,14 +1363,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } // GCC provides a macro definition '__DEPRECATED' when -Wdeprecated is active - // during C++ compilation. CC1 uses '-fdeprecated-macro' to control this. - // Both '-Wdeprecated' and '-fdeprecated-macro' default to on, so the flag - // logic here is inverted. - if (Args.hasFlag(options::OPT_Wno_deprecated, options::OPT_Wdeprecated, - false)) { - // GCC keeps this define even in the presence of '-w', match this behavior - // bug-for-bug. - CmdArgs.push_back("-fno-deprecated-macro"); + // during C++ compilation, which it is by default. GCC keeps this define even + // in the presence of '-w', match this behavior bug-for-bug. + if (types::isCXX(InputType) && + Args.hasFlag(options::OPT_Wdeprecated, options::OPT_Wno_deprecated, + true)) { + CmdArgs.push_back("-fdeprecated-macro"); } // Translate GCC's misnamer '-fasm' arguments to '-fgnu-keywords'. -- cgit v1.2.3-18-g5258