summaryrefslogtreecommitdiffstats
path: root/clang/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
commiteda8e12e86706b694e6f7a0b744d7683a167798a (patch)
tree6fc9e4c087d9a1e75640e2c8deea848a4d4e3d4c /clang/lib/Serialization/ASTWriter.cpp
parent8769449b610472ceed72f7573a26a652fa76f3db (diff)
downloadbcm5719-llvm-eda8e12e86706b694e6f7a0b744d7683a167798a.tar.gz
bcm5719-llvm-eda8e12e86706b694e6f7a0b744d7683a167798a.zip
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. llvm-svn: 137120
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index f23a0cdce9a..256bf9da3e5 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/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));
}
OpenPOWER on IntegriCloud