diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-18 18:36:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-18 18:36:53 +0000 |
commit | 39c497b6d5e99acecbe03ee173249ee21933e855 (patch) | |
tree | 492ae6de7a512e321f32c981d8bec1ab3324f333 /lib/Serialization/ASTWriter.cpp | |
parent | 7ae467f02b0f2ba3897ee03e0d011433789b5434 (diff) |
Collapse the original file name and original file ID records into a
single record.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166206 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 3814ef1e76..ea3db882d7 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -773,8 +773,7 @@ void ASTWriter::WriteBlockInfoBlock() { RECORD(IMPORTS); RECORD(LANGUAGE_OPTIONS); RECORD(TARGET_OPTIONS); - RECORD(ORIGINAL_FILE_NAME); - RECORD(ORIGINAL_FILE_ID); + RECORD(ORIGINAL_FILE); RECORD(ORIGINAL_PCH_DIR); // AST Top-Level Block. @@ -1070,7 +1069,8 @@ void ASTWriter::WriteControlBlock(ASTContext &Context, StringRef isysroot, SourceManager &SM = Context.getSourceManager(); if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) { BitCodeAbbrev *FileAbbrev = new BitCodeAbbrev(); - FileAbbrev->Add(BitCodeAbbrevOp(ORIGINAL_FILE_NAME)); + FileAbbrev->Add(BitCodeAbbrevOp(ORIGINAL_FILE)); + FileAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // File ID FileAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // File name unsigned FileAbbrevCode = Stream.EmitAbbrev(FileAbbrev); @@ -1082,12 +1082,10 @@ void ASTWriter::WriteControlBlock(ASTContext &Context, StringRef isysroot, MainFileNameStr = adjustFilenameForRelocatablePCH(MainFileNameStr, isysroot); RecordData Record; - Record.push_back(ORIGINAL_FILE_NAME); + Record.push_back(ORIGINAL_FILE); + Record.push_back(SM.getMainFileID().getOpaqueValue()); Stream.EmitRecordWithBlob(FileAbbrevCode, Record, MainFileNameStr); - Record.clear(); - Record.push_back(SM.getMainFileID().getOpaqueValue()); - Stream.EmitRecord(ORIGINAL_FILE_ID, Record); } // Original PCH directory |