diff options
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 7753986d58f..35da82c6e4c 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -866,6 +866,7 @@ void ASTWriter::WriteBlockInfoBlock() { RECORD(MACRO_OFFSET); RECORD(MACRO_TABLE); RECORD(LATE_PARSED_TEMPLATE); + RECORD(OPTIMIZE_PRAGMA_OPTIONS); // SourceManager Block. BLOCK(SOURCE_MANAGER_BLOCK); @@ -3850,6 +3851,14 @@ void ASTWriter::WriteLateParsedTemplates(Sema &SemaRef) { Stream.EmitRecord(LATE_PARSED_TEMPLATE, Record); } +/// \brief Write the state of 'pragma clang optimize' at the end of the module. +void ASTWriter::WriteOptimizePragmaOptions(Sema &SemaRef) { + RecordData Record; + SourceLocation PragmaLoc = SemaRef.getOptimizeOffPragmaLocation(); + AddSourceLocation(PragmaLoc, Record); + Stream.EmitRecord(OPTIMIZE_PRAGMA_OPTIONS, Record); +} + //===----------------------------------------------------------------------===// // General Serialization Routines //===----------------------------------------------------------------------===// @@ -4466,6 +4475,8 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, WriteMergedDecls(); WriteObjCCategories(); WriteLateParsedTemplates(SemaRef); + if(!WritingModule) + WriteOptimizePragmaOptions(SemaRef); // Some simple statistics Record.clear(); |