diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-09-08 19:40:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-09-08 19:40:14 +0000 |
commit | 0516b1864d1cf92c497d64a7cd712e47a74396bc (patch) | |
tree | bcbd497228efe85a7dfd92f947438dc9f891f63a /clang/lib/Serialization/ASTWriter.cpp | |
parent | 966a94f8614266c5b964f185cd2e288fbdeb802f (diff) | |
download | bcm5719-llvm-0516b1864d1cf92c497d64a7cd712e47a74396bc.tar.gz bcm5719-llvm-0516b1864d1cf92c497d64a7cd712e47a74396bc.zip |
[modules] Write the options records to a separate subblock rather than writing
them directly to the control block. These are fairly large, and in a build with
lots of modules / chained PCH, we don't need to read most of them. No
functionality change intended.
llvm-svn: 247055
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 225a00c942f..dfcc539284b 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -881,12 +881,14 @@ void ASTWriter::WriteBlockInfoBlock() { RECORD(MODULE_DIRECTORY); RECORD(MODULE_MAP_FILE); RECORD(IMPORTS); - RECORD(LANGUAGE_OPTIONS); - RECORD(TARGET_OPTIONS); RECORD(ORIGINAL_FILE); RECORD(ORIGINAL_PCH_DIR); RECORD(ORIGINAL_FILE_ID); RECORD(INPUT_FILE_OFFSETS); + + BLOCK(OPTIONS_BLOCK); + RECORD(LANGUAGE_OPTIONS); + RECORD(TARGET_OPTIONS); RECORD(DIAGNOSTIC_OPTIONS); RECORD(FILE_SYSTEM_OPTIONS); RECORD(HEADER_SEARCH_OPTIONS); @@ -1288,6 +1290,9 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context, Stream.EmitRecord(IMPORTS, Record); } + // Write the options block. + Stream.EnterSubblock(OPTIONS_BLOCK_ID, 4); + // Language options. Record.clear(); const LangOptions &LangOpts = Context.getLangOpts(); @@ -1427,6 +1432,9 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context, Record.push_back(static_cast<unsigned>(PPOpts.ObjCXXARCStandardLibrary)); Stream.EmitRecord(PREPROCESSOR_OPTIONS, Record); + // Leave the options block. + Stream.ExitBlock(); + // Original file name and file ID SourceManager &SM = Context.getSourceManager(); if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) { |