aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-04-23 19:48:40 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-04-23 19:48:40 +0000
commitf8c247d247f9f7ab2bf4965677e6d056711c99d5 (patch)
tree54999eae5d265dd8ffb3c5542fdd977dced511df /lib/Driver/Tools.cpp
parent89ebaed91cca7fd296ec7804e4e9fb68949c1d0e (diff)
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
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp14
1 files changed, 6 insertions, 8 deletions
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'.