From a88942ad9c8b5ab43dc537b3a49c1368f4717fe4 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sat, 15 Jan 2011 02:56:16 +0000 Subject: [PATCH] Store/retrieve -fshort-enums for PCH, fixes rdar://8854933. llvm-svn: 123510 --- clang/lib/Serialization/ASTReader.cpp | 1 + clang/lib/Serialization/ASTWriter.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index c6ecdea410a3..584abfbcd1d7 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2630,6 +2630,7 @@ bool ASTReader::ParseLanguageOptions( PARSE_LANGOPT(AccessControl); PARSE_LANGOPT(CharIsSigned); PARSE_LANGOPT(ShortWChar); + PARSE_LANGOPT(ShortEnums); LangOpts.setGCMode((LangOptions::GCMode)Record[Idx++]); LangOpts.setVisibilityMode((Visibility)Record[Idx++]); LangOpts.setStackProtectorMode((LangOptions::StackProtectorMode) diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 54a2648cd3c7..4fa48faec529 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -941,6 +941,9 @@ void ASTWriter::WriteLanguageOptions(const LangOptions &LangOpts) { Record.push_back(LangOpts.CharIsSigned); // Whether char is a signed or // unsigned type Record.push_back(LangOpts.ShortWChar); // force wchar_t to be unsigned short + Record.push_back(LangOpts.ShortEnums); // Should the enum type be equivalent + // to the smallest integer type with + // enough room. Record.push_back(LangOpts.getGCMode()); Record.push_back(LangOpts.getVisibilityMode()); Record.push_back(LangOpts.getStackProtectorMode());