diff options
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index daaaad0c2c6..998ca8aa4ad 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/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/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 802d66ff0ea..58379d3459f 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/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) |