diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-04-23 19:48:40 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-04-23 19:48:40 +0000 |
commit | f8c247d247f9f7ab2bf4965677e6d056711c99d5 (patch) | |
tree | 54999eae5d265dd8ffb3c5542fdd977dced511df /lib/Frontend | |
parent | 89ebaed91cca7fd296ec7804e4e9fb68949c1d0e (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/Frontend')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/InitPreprocessor.cpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index daaaad0c2c..998ca8aa4a 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -694,8 +694,8 @@ static void LangOptsToArgs(const LangOptions &Opts, Res.push_back("-funknown-anytype"); if (Opts.DelayedTemplateParsing) Res.push_back("-fdelayed-template-parsing"); - if (!Opts.Deprecated) - Res.push_back("-fno-deprecated-macro"); + if (Opts.Deprecated) + Res.push_back("-fdeprecated-macro"); } static void PreprocessorOptsToArgs(const PreprocessorOptions &Opts, diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 802d66ff0e..58379d3459 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -318,9 +318,10 @@ static void InitializePredefinedMacros(const TargetInfo &TI, if (LangOpts.SjLjExceptions) Builder.defineMacro("__USING_SJLJ_EXCEPTIONS__"); + if (LangOpts.Deprecated) + Builder.defineMacro("__DEPRECATED"); + if (LangOpts.CPlusPlus) { - if (LangOpts.Deprecated) - Builder.defineMacro("__DEPRECATED"); Builder.defineMacro("__GNUG__", "4"); Builder.defineMacro("__GXX_WEAK__"); if (LangOpts.GNUMode) |