From 0db720f0dc5b62bfcde72a2761fc9793af4e4558 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 11 Oct 2012 16:05:00 +0000 Subject: [libclang] Improve AST serialization done by ASTUnit::Save(). The ASTUnit needs to initialize an ASTWriter at the beginning of parsing to fully handle serialization of a translation unit that imports modules. Do this by introducing an option to enable it, which corresponds to CXTranslationUnit_ForSerialization on the C API side. llvm-svn: 165717 --- clang/lib/Serialization/ASTWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Serialization/ASTWriter.cpp') diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index b7d6d9cecff..28f78c61810 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -3423,8 +3423,8 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls, // Write the remaining AST contents. RecordData Record; Stream.EnterSubblock(AST_BLOCK_ID, 5); - WriteMetadata(Context, isysroot, OutputFile); WriteLanguageOptions(Context.getLangOpts()); + WriteMetadata(Context, isysroot, OutputFile); if (StatCalls && isysroot.empty()) WriteStatCache(*StatCalls); -- cgit v1.2.3