summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp8
-rw-r--r--clang/lib/Frontend/PCHWriter.cpp9
2 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index dc8d3fce34f..6c79b8a5a57 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -1316,6 +1316,10 @@ PCHReader::PCHReadResult PCHReader::ReadPCHBlock() {
ExternalDefinitions.swap(Record);
break;
+ case pch::SPECIAL_TYPES:
+ SpecialTypes.swap(Record);
+ break;
+
case pch::STATISTICS:
TotalNumStatements = Record[0];
break;
@@ -1399,6 +1403,10 @@ PCHReader::PCHReadResult PCHReader::ReadPCH(const std::string &FileName) {
// Load the translation unit declaration
ReadDeclRecord(DeclOffsets[0], 0);
+ // Load the special types.
+ Context.setBuiltinVaListType(
+ GetType(SpecialTypes[pch::SPECIAL_TYPE_BUILTIN_VA_LIST]));
+
return Success;
}
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp
index d7f0cd3497f..db9a1cebe56 100644
--- a/clang/lib/Frontend/PCHWriter.cpp
+++ b/clang/lib/Frontend/PCHWriter.cpp
@@ -1739,6 +1739,7 @@ void PCHWriter::WritePCH(ASTContext &Context, const Preprocessor &PP) {
DeclsToEmit.push(Context.getTranslationUnitDecl());
// Write the remaining PCH contents.
+ RecordData Record;
Stream.EnterSubblock(pch::PCH_BLOCK_ID, 3);
WriteTargetTriple(Context.Target);
WriteLanguageOptions(Context.getLangOptions());
@@ -1749,11 +1750,17 @@ void PCHWriter::WritePCH(ASTContext &Context, const Preprocessor &PP) {
WriteIdentifierTable();
Stream.EmitRecord(pch::TYPE_OFFSET, TypeOffsets);
Stream.EmitRecord(pch::DECL_OFFSET, DeclOffsets);
+
+ // Write the record of special types.
+ Record.clear();
+ AddTypeRef(Context.getBuiltinVaListType(), Record);
+ Stream.EmitRecord(pch::SPECIAL_TYPES, Record);
+
if (!ExternalDefinitions.empty())
Stream.EmitRecord(pch::EXTERNAL_DEFINITIONS, ExternalDefinitions);
// Some simple statistics
- RecordData Record;
+ Record.clear();
Record.push_back(NumStatements);
Stream.EmitRecord(pch::STATISTICS, Record);
Stream.ExitBlock();
OpenPOWER on IntegriCloud