summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-04-23 20:05:38 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-04-23 20:05:38 +0000
commit7ffce73fc8bb1be470df9a2558e8bb0bd9da7678 (patch)
treef7f0e2ebde5f0b8cd252fc1bb85a1abca0d9a375 /clang/lib/Serialization
parent1a180156b652e515933adfb6c3302a470d467e04 (diff)
downloadbcm5719-llvm-7ffce73fc8bb1be470df9a2558e8bb0bd9da7678.tar.gz
bcm5719-llvm-7ffce73fc8bb1be470df9a2558e8bb0bd9da7678.zip
Teach the AST reader and writer to preserve the __DEPRECATED bit in
language options, and warn when reading an AST with a different value for the bit. There doesn't appear to be a good way to test this (commenting out similar other language options doesn't break anything) but if folks have suggestions on tests I'm happy to add them. llvm-svn: 130071
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp2
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index dafce43a5d1..3525c702078 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -129,6 +129,7 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
PARSE_LANGOPT_IMPORTANT(PICLevel, diag::warn_pch_pic_level);
PARSE_LANGOPT_IMPORTANT(GNUInline, diag::warn_pch_gnu_inline);
PARSE_LANGOPT_IMPORTANT(NoInline, diag::warn_pch_no_inline);
+ PARSE_LANGOPT_IMPORTANT(Deprecated, diag::warn_pch_deprecated);
PARSE_LANGOPT_IMPORTANT(AccessControl, diag::warn_pch_access_control);
PARSE_LANGOPT_IMPORTANT(CharIsSigned, diag::warn_pch_char_signed);
PARSE_LANGOPT_IMPORTANT(ShortWChar, diag::warn_pch_short_wchar);
@@ -2838,6 +2839,7 @@ bool ASTReader::ParseLanguageOptions(
PARSE_LANGOPT(PICLevel);
PARSE_LANGOPT(GNUInline);
PARSE_LANGOPT(NoInline);
+ PARSE_LANGOPT(Deprecated);
PARSE_LANGOPT(AccessControl);
PARSE_LANGOPT(CharIsSigned);
PARSE_LANGOPT(ShortWChar);
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 97b0a2f8ab1..05078cc0120 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -1063,6 +1063,7 @@ void ASTWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
Record.push_back(LangOpts.GNUInline); // Should GNU inline semantics be
// used (instead of C99 semantics).
Record.push_back(LangOpts.NoInline); // Should __NO_INLINE__ be defined.
+ Record.push_back(LangOpts.Deprecated); // Should __DEPRECATED be defined.
Record.push_back(LangOpts.AccessControl); // Whether C++ access control should
// be enabled.
Record.push_back(LangOpts.CharIsSigned); // Whether char is a signed or
OpenPOWER on IntegriCloud