aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-09 15:13:55 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-09 15:13:55 +0000
commit3b8043b49aff6e5d70f29ef5684214ce2473763c (patch)
tree6e5de9a3e146bb39b7baad6d1aa1b8c14c9c6d37 /lib/Serialization/ASTWriter.cpp
parente802c613f2a24153c5fcb2474b4c7c66b29153a8 (diff)
Migrate the serialization of ASTContext's AutoDeduceTy and
AutoRRefDeductTy from the "special types" block to predefined types. The latter behaves better when loading multiple AST files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r--lib/Serialization/ASTWriter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index f23a0cdce9..256bf9da3e 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -2754,7 +2754,7 @@ void ASTWriter::SetSelectorOffset(Selector Sel, uint32_t Offset) {
}
ASTWriter::ASTWriter(llvm::BitstreamWriter &Stream)
- : Stream(Stream), Chain(0), SerializationListener(0),
+ : Stream(Stream), Context(0), Chain(0), SerializationListener(0),
FirstDeclID(NUM_PREDEF_DECL_IDS), NextDeclID(FirstDeclID),
FirstTypeID(NUM_PREDEF_TYPE_IDS), NextTypeID(FirstTypeID),
FirstIdentID(NUM_PREDEF_IDENT_IDS), NextIdentID(FirstIdentID),
@@ -2785,10 +2785,12 @@ void ASTWriter::WriteAST(Sema &SemaRef, MemorizeStatCalls *StatCalls,
WriteBlockInfoBlock();
+ Context = &SemaRef.Context;
if (Chain)
WriteASTChain(SemaRef, StatCalls, isysroot);
else
WriteASTCore(SemaRef, StatCalls, isysroot, OutputFile);
+ Context = 0;
}
template<typename Vector>
@@ -2943,8 +2945,6 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
AddTypeRef(Context.ObjCSelRedefinitionType, SpecialTypes);
AddTypeRef(Context.getRawNSConstantStringType(), SpecialTypes);
SpecialTypes.push_back(Context.isInt128Installed());
- AddTypeRef(Context.AutoDeductTy, SpecialTypes);
- AddTypeRef(Context.AutoRRefDeductTy, SpecialTypes);
// Keep writing types and declarations until all types and
// declarations have been written.
@@ -3500,13 +3500,13 @@ void ASTWriter::AddTypeRef(QualType T, RecordDataImpl &Record) {
Record.push_back(GetOrCreateTypeID(T));
}
-TypeID ASTWriter::GetOrCreateTypeID(QualType T) {
- return MakeTypeID(T,
+TypeID ASTWriter::GetOrCreateTypeID( QualType T) {
+ return MakeTypeID(*Context, T,
std::bind1st(std::mem_fun(&ASTWriter::GetOrCreateTypeIdx), this));
}
TypeID ASTWriter::getTypeID(QualType T) const {
- return MakeTypeID(T,
+ return MakeTypeID(*Context, T,
std::bind1st(std::mem_fun(&ASTWriter::getTypeIdx), this));
}