summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-18 05:55:16 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-18 05:55:16 +0000
commit652d82a096996d5ee7665b2905742e1a23364862 (patch)
treeb52abc42538d2a90979a4bd1ea6212cfade8ac51 /clang/lib/Frontend/PCHWriter.cpp
parent6c8bcf9da1d2c568c855e673d16811dc03c1f452 (diff)
downloadbcm5719-llvm-652d82a096996d5ee7665b2905742e1a23364862.tar.gz
bcm5719-llvm-652d82a096996d5ee7665b2905742e1a23364862.zip
Store the type ID for __builtin_va_list in the PCH file, so that the
AST context's __builtin_va_list type will be set when the PCH file is loaded. This fixes the crash when CodeGen'ing a va_arg expression pulled in from a PCH file. llvm-svn: 69421
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r--clang/lib/Frontend/PCHWriter.cpp9
1 files changed, 8 insertions, 1 deletions
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