<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 9, 2015, at 7:06 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Wed, Sep 9, 2015 at 6:46 PM, Mehdi Amini via cfe-commits<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Author: mehdi_amini<br class="">Date: Wed Sep 9 20:46:39 2015<br class="">New Revision: 247233<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=247233&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=247233&view=rev</a><br class="">Log:<br class="">EmitRecord* API change: accepts ArrayRef instead of a SmallVector (NFC)<br class=""><br class="">This reapply a variant commit r247179 after post-commit review from<br class="">D.Blaikie.<br class="">Hopefully I got it right this time: lifetime of initializer list ends<br class="">as with any expression, which make invalid the pattern:<br class=""><br class="">ArrayRef<int> Arr = { 1, 2, 3, 4};<br class=""><br class="">Just like StringRef, ArrayRef shouldn't be used to initialize local<br class="">variable but only as function argument.<br class=""></blockquote><div class=""><br class=""></div><div class="">Looks pretty reasonable - I'll mention it again, just in case: removing the named variables and just putting the init lists directly in the call might be as (or more) readable - might be worth giving it a go & running it through clang-format to see what you think.<br class=""></div></div></div></blockquote><div><br class=""></div><div>Here is an example, let me know what do you think:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> RecordData::value_type Record[] = {METADATA, VERSION_MAJOR, VERSION_MINOR,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">CLANG_VERSION_MAJOR</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">CLANG_VERSION_MINOR</span>,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> !isysroot.empty(), IncludeTimestamps,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> ASTHasCompilerErrors};</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> Stream.EmitRecordWithBlob(MetadataAbbrevCode, Record,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> getClangFullRepositoryVersion());</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> Stream.EmitRecordWithBlob(</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> MetadataAbbrevCode,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (uint64_t[]){METADATA, VERSION_MAJOR, VERSION_MINOR, <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">CLANG_VERSION_MAJOR</span>,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff" class="">CLANG_VERSION_MINOR</span>, !isysroot.empty(), IncludeTimestamps,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> ASTHasCompilerErrors},</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> getClangFullRepositoryVersion());</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><div class=""><br class=""></div></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class="">- Dave</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><br class="">From: Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>><br class=""><br class="">Modified:<br class=""> <span class="Apple-converted-space"> </span>cfe/trunk/include/clang/Serialization/ASTWriter.h<br class=""> <span class="Apple-converted-space"> </span>cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp<br class=""> <span class="Apple-converted-space"> </span>cfe/trunk/lib/Serialization/ASTWriter.cpp<br class=""> <span class="Apple-converted-space"> </span>cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp<br class=""><br class="">Modified: cfe/trunk/include/clang/Serialization/ASTWriter.h<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=247233&r1=247232&r2=247233&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=247233&r1=247232&r2=247233&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/include/clang/Serialization/ASTWriter.h (original)<br class="">+++ cfe/trunk/include/clang/Serialization/ASTWriter.h Wed Sep 9 20:46:39 2015<br class="">@@ -84,6 +84,7 @@ class ASTWriter : public ASTDeserializat<br class=""> public:<br class=""> typedef SmallVector<uint64_t, 64> RecordData;<br class=""> typedef SmallVectorImpl<uint64_t> RecordDataImpl;<br class="">+ typedef ArrayRef<uint64_t> RecordDataRef;<br class=""><br class=""> friend class ASTDeclWriter;<br class=""> friend class ASTStmtWriter;<br class="">@@ -756,7 +757,7 @@ public:<br class=""> void AddPath(StringRef Path, RecordDataImpl &Record);<br class=""><br class=""> /// \brief Emit the current record with the given path as a blob.<br class="">- void EmitRecordWithPath(unsigned Abbrev, RecordDataImpl &Record,<br class="">+ void EmitRecordWithPath(unsigned Abbrev, RecordDataRef Record,<br class=""> StringRef Path);<br class=""><br class=""> /// \brief Add a version tuple to the given record<br class=""><br class="">Modified: cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp?rev=247233&r1=247232&r2=247233&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp?rev=247233&r1=247232&r2=247233&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp (original)<br class="">+++ cfe/trunk/lib/Frontend/SerializedDiagnosticPrinter.cpp Wed Sep 9 20:46:39 2015<br class="">@@ -51,6 +51,7 @@ public:<br class=""><br class=""> typedef SmallVector<uint64_t, 64> RecordData;<br class=""> typedef SmallVectorImpl<uint64_t> RecordDataImpl;<br class="">+typedef ArrayRef<uint64_t> RecordDataRef;<br class=""><br class=""> class SDiagsWriter;<br class=""><br class="">@@ -393,13 +394,9 @@ unsigned SDiagsWriter::getEmitFile(const<br class=""><br class=""> // Lazily generate the record for the file.<br class=""> entry = State->Files.size();<br class="">- RecordData Record;<br class="">- Record.push_back(RECORD_FILENAME);<br class="">- Record.push_back(entry);<br class="">- Record.push_back(0); // For legacy.<br class="">- Record.push_back(0); // For legacy.<br class=""> StringRef Name(FileName);<br class="">- Record.push_back(Name.size());<br class="">+ RecordData::value_type Record[] = {RECORD_FILENAME, entry, 0 /* For legacy */,<br class="">+ 0 /* For legacy */, Name.size()};<br class=""> State->Stream.EmitRecordWithBlob(State->Abbrevs.get(RECORD_FILENAME), Record,<br class=""> <span class="Apple-converted-space"> </span>Name);<br class=""><br class="">@@ -531,14 +528,11 @@ void SDiagsWriter::EmitBlockInfoBlock()<br class=""><br class=""> void SDiagsWriter::EmitMetaBlock() {<br class=""> llvm::BitstreamWriter &Stream = State->Stream;<br class="">- RecordData &Record = State->Record;<br class=""> AbbreviationMap &Abbrevs = State->Abbrevs;<br class=""><br class=""> Stream.EnterSubblock(BLOCK_META, 3);<br class="">- Record.clear();<br class="">- Record.push_back(RECORD_VERSION);<br class="">- Record.push_back(VersionNumber);<br class="">- Stream.EmitRecordWithAbbrev(Abbrevs.get(RECORD_VERSION), Record);<br class="">+ RecordData::value_type Record[] = {RECORD_VERSION, VersionNumber};<br class="">+ Stream.EmitRecordWithAbbrev(Abbrevs.get(RECORD_VERSION), Record);<br class=""> Stream.ExitBlock();<br class=""> }<br class=""><br class="">@@ -548,11 +542,8 @@ unsigned SDiagsWriter::getEmitCategory(u<br class=""><br class=""> // We use a local version of 'Record' so that we can be generating<br class=""> // another record when we lazily generate one for the category entry.<br class="">- RecordData Record;<br class="">- Record.push_back(RECORD_CATEGORY);<br class="">- Record.push_back(category);<br class=""> StringRef catName = DiagnosticIDs::getCategoryNameFromID(category);<br class="">- Record.push_back(catName.size());<br class="">+ RecordData::value_type Record[] = {RECORD_CATEGORY, category, catName.size()};<br class=""> State->Stream.EmitRecordWithBlob(State->Abbrevs.get(RECORD_CATEGORY), Record,<br class=""> <span class="Apple-converted-space"> </span>catName);<br class=""><br class="">@@ -581,10 +572,8 @@ unsigned SDiagsWriter::getEmitDiagnostic<br class=""> entry.second = FlagName;<br class=""><br class=""> // Lazily emit the string in a separate record.<br class="">- RecordData Record;<br class="">- Record.push_back(RECORD_DIAG_FLAG);<br class="">- Record.push_back(entry.first);<br class="">- Record.push_back(FlagName.size());<br class="">+ RecordData::value_type Record[] = {RECORD_DIAG_FLAG, entry.first,<br class="">+ FlagName.size()};<br class=""> State->Stream.EmitRecordWithBlob(State->Abbrevs.get(RECORD_DIAG_FLAG),<br class=""> <span class="Apple-converted-space"> </span>Record, FlagName);<br class=""> }<br class="">@@ -844,17 +833,9 @@ std::error_code SDiagsMerger::visitEndOf<br class=""> std::error_code<br class=""> SDiagsMerger::visitSourceRangeRecord(const serialized_diags::Location &Start,<br class=""> <span class="Apple-converted-space"> </span>const serialized_diags::Location &End) {<br class="">- RecordData Record;<br class="">- Record.push_back(RECORD_SOURCE_RANGE);<br class="">- Record.push_back(FileLookup[Start.FileID]);<br class="">- Record.push_back(Start.Line);<br class="">- Record.push_back(Start.Col);<br class="">- Record.push_back(Start.Offset);<br class="">- Record.push_back(FileLookup[End.FileID]);<br class="">- Record.push_back(End.Line);<br class="">- Record.push_back(End.Col);<br class="">- Record.push_back(End.Offset);<br class="">-<br class="">+ RecordData::value_type Record[] = {<br class="">+ RECORD_SOURCE_RANGE, FileLookup[Start.FileID], Start.Line, Start.Col,<br class="">+ Start.Offset, FileLookup[End.FileID], End.Line, End.Col, End.Offset};<br class=""> Writer.State->Stream.EmitRecordWithAbbrev(<br class=""> Writer.State->Abbrevs.get(RECORD_SOURCE_RANGE), Record);<br class=""> return std::error_code();<br class="">@@ -863,19 +844,13 @@ SDiagsMerger::visitSourceRangeRecord(con<br class=""> std::error_code SDiagsMerger::visitDiagnosticRecord(<br class=""> unsigned Severity, const serialized_diags::Location &Location,<br class=""> unsigned Category, unsigned Flag, StringRef Message) {<br class="">- RecordData MergedRecord;<br class="">- MergedRecord.push_back(RECORD_DIAG);<br class="">- MergedRecord.push_back(Severity);<br class="">- MergedRecord.push_back(FileLookup[Location.FileID]);<br class="">- MergedRecord.push_back(Location.Line);<br class="">- MergedRecord.push_back(Location.Col);<br class="">- MergedRecord.push_back(Location.Offset);<br class="">- MergedRecord.push_back(CategoryLookup[Category]);<br class="">- MergedRecord.push_back(Flag ? DiagFlagLookup[Flag] : 0);<br class="">- MergedRecord.push_back(Message.size());<br class="">+ RecordData::value_type Record[] = {<br class="">+ RECORD_DIAG, Severity, FileLookup[Location.FileID], Location.Line,<br class="">+ Location.Col, Location.Offset, CategoryLookup[Category],<br class="">+ Flag ? DiagFlagLookup[Flag] : 0, Message.size()};<br class=""><br class=""> Writer.State->Stream.EmitRecordWithBlob(<br class="">- Writer.State->Abbrevs.get(RECORD_DIAG), MergedRecord, Message);<br class="">+ Writer.State->Abbrevs.get(RECORD_DIAG), Record, Message);<br class=""> return std::error_code();<br class=""> }<br class=""><br class="">@@ -883,17 +858,10 @@ std::error_code<br class=""> SDiagsMerger::visitFixitRecord(const serialized_diags::Location &Start,<br class=""> <span class="Apple-converted-space"> </span>const serialized_diags::Location &End,<br class=""> <span class="Apple-converted-space"> </span>StringRef Text) {<br class="">- RecordData Record;<br class="">- Record.push_back(RECORD_FIXIT);<br class="">- Record.push_back(FileLookup[Start.FileID]);<br class="">- Record.push_back(Start.Line);<br class="">- Record.push_back(Start.Col);<br class="">- Record.push_back(Start.Offset);<br class="">- Record.push_back(FileLookup[End.FileID]);<br class="">- Record.push_back(End.Line);<br class="">- Record.push_back(End.Col);<br class="">- Record.push_back(End.Offset);<br class="">- Record.push_back(Text.size());<br class="">+ RecordData::value_type Record[] = {RECORD_FIXIT, FileLookup[Start.FileID],<br class="">+ Start.Line, Start.Col, Start.Offset,<br class="">+ FileLookup[End.FileID], End.Line, End.Col,<br class="">+ End.Offset, Text.size()};<br class=""><br class=""> Writer.State->Stream.EmitRecordWithBlob(<br class=""> Writer.State->Abbrevs.get(RECORD_FIXIT), Record, Text);<br class=""><br class="">Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=247233&r1=247232&r2=247233&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=247233&r1=247232&r2=247233&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)<br class="">+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Wed Sep 9 20:46:39 2015<br class="">@@ -1185,27 +1185,23 @@ void ASTWriter::WriteControlBlock(Prepro<br class=""> MetadataAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Errors<br class=""> MetadataAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // SVN branch/tag<br class=""> unsigned MetadataAbbrevCode = Stream.EmitAbbrev(MetadataAbbrev);<br class="">- Record.push_back(METADATA);<br class="">- Record.push_back(VERSION_MAJOR);<br class="">- Record.push_back(VERSION_MINOR);<br class="">- Record.push_back(CLANG_VERSION_MAJOR);<br class="">- Record.push_back(CLANG_VERSION_MINOR);<br class=""> assert((!WritingModule || isysroot.empty()) &&<br class=""> <span class="Apple-converted-space"> </span>"writing module as a relocatable PCH?");<br class="">- Record.push_back(!isysroot.empty());<br class="">- Record.push_back(IncludeTimestamps);<br class="">- Record.push_back(ASTHasCompilerErrors);<br class="">- Stream.EmitRecordWithBlob(MetadataAbbrevCode, Record,<br class="">- getClangFullRepositoryVersion());<br class="">-<br class="">+ {<br class="">+ RecordData::value_type Record[] = {METADATA, VERSION_MAJOR, VERSION_MINOR,<br class="">+ CLANG_VERSION_MAJOR, CLANG_VERSION_MINOR,<br class="">+ !isysroot.empty(), IncludeTimestamps,<br class="">+ ASTHasCompilerErrors};<br class="">+ Stream.EmitRecordWithBlob(MetadataAbbrevCode, Record,<br class="">+ getClangFullRepositoryVersion());<br class="">+ }<br class=""> if (WritingModule) {<br class=""> // For implicit modules we output a signature that we can use to ensure<br class=""> // duplicate module builds don't collide in the cache as their output order<br class=""> // is non-deterministic.<br class=""> // FIXME: Remove this when output is deterministic.<br class=""> if (Context.getLangOpts().ImplicitModules) {<br class="">- Record.clear();<br class="">- Record.push_back(getSignature());<br class="">+ RecordData::value_type Record[] = {getSignature()};<br class=""> Stream.EmitRecord(SIGNATURE, Record);<br class=""> }<br class=""><br class="">@@ -1214,8 +1210,7 @@ void ASTWriter::WriteControlBlock(Prepro<br class=""> Abbrev->Add(BitCodeAbbrevOp(MODULE_NAME));<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Name<br class=""> unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev);<br class="">- RecordData Record;<br class="">- Record.push_back(MODULE_NAME);<br class="">+ RecordData::value_type Record[] = {MODULE_NAME};<br class=""> Stream.EmitRecordWithBlob(AbbrevCode, Record, WritingModule->Name);<br class=""> }<br class=""><br class="">@@ -1236,8 +1231,7 @@ void ASTWriter::WriteControlBlock(Prepro<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Directory<br class=""> unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev);<br class=""><br class="">- RecordData Record;<br class="">- Record.push_back(MODULE_DIRECTORY);<br class="">+ RecordData::value_type Record[] = {MODULE_DIRECTORY};<br class=""> Stream.EmitRecordWithBlob(AbbrevCode, Record, BaseDir);<br class=""> }<br class=""><br class="">@@ -1466,8 +1460,7 @@ void ASTWriter::WriteControlBlock(Prepro<br class=""> SM.getFileManager().makeAbsolutePath(OutputPath);<br class=""> StringRef origDir = llvm::sys::path::parent_path(OutputPath);<br class=""><br class="">- RecordData Record;<br class="">- Record.push_back(ORIGINAL_PCH_DIR);<br class="">+ RecordData::value_type Record[] = {ORIGINAL_PCH_DIR};<br class=""> Stream.EmitRecordWithBlob(AbbrevCode, Record, origDir);<br class=""> }<br class=""><br class="">@@ -1491,8 +1484,7 @@ void ASTWriter::WriteInputFiles(SourceMa<br class=""> bool Modules) {<br class=""> using namespace llvm;<br class=""> Stream.EnterSubblock(INPUT_FILES_BLOCK_ID, 4);<br class="">- RecordData Record;<br class="">-<br class="">+<br class=""> // Create input-file abbreviation.<br class=""> BitCodeAbbrev *IFAbbrev = new BitCodeAbbrev();<br class=""> IFAbbrev->Add(BitCodeAbbrevOp(INPUT_FILE));<br class="">@@ -1547,16 +1539,11 @@ void ASTWriter::WriteInputFiles(SourceMa<br class=""> if (!Entry.IsSystemFile)<br class=""> ++UserFilesNum;<br class=""><br class="">- Record.clear();<br class="">- Record.push_back(INPUT_FILE);<br class="">- Record.push_back(InputFileOffsets.size());<br class="">-<br class=""> // Emit size/modification time for this file.<br class="">- Record.push_back(Entry.File->getSize());<br class="">- Record.push_back(getTimestampForOutput(Entry.File));<br class="">-<br class="">- // Whether this file was overridden.<br class="">- Record.push_back(Entry.BufferOverridden);<br class="">+ // And whether this file was overridden.<br class="">+ RecordData::value_type Record[] = {<br class="">+ INPUT_FILE, InputFileOffsets.size(), (uint64_t)Entry.File->getSize(),<br class="">+ (uint64_t)getTimestampForOutput(Entry.File), Entry.BufferOverridden};<br class=""><br class=""> EmitRecordWithPath(IFAbbrevCode, Record, Entry.File->getName());<br class=""> }<br class="">@@ -1573,10 +1560,8 @@ void ASTWriter::WriteInputFiles(SourceMa<br class=""> unsigned OffsetsAbbrevCode = Stream.EmitAbbrev(OffsetsAbbrev);<br class=""><br class=""> // Write input file offsets.<br class="">- Record.clear();<br class="">- Record.push_back(INPUT_FILE_OFFSETS);<br class="">- Record.push_back(InputFileOffsets.size());<br class="">- Record.push_back(UserFilesNum);<br class="">+ RecordData::value_type Record[] = {INPUT_FILE_OFFSETS,<br class="">+ InputFileOffsets.size(), UserFilesNum};<br class=""> Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, bytes(InputFileOffsets));<br class=""> }<br class=""><br class="">@@ -1818,11 +1803,8 @@ void ASTWriter::WriteHeaderSearch(const<br class=""> unsigned TableAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class=""> // Write the header search table<br class="">- RecordData Record;<br class="">- Record.push_back(HEADER_SEARCH_TABLE);<br class="">- Record.push_back(BucketOffset);<br class="">- Record.push_back(NumHeaderSearchEntries);<br class="">- Record.push_back(TableData.size());<br class="">+ RecordData::value_type Record[] = {HEADER_SEARCH_TABLE, BucketOffset,<br class="">+ NumHeaderSearchEntries, TableData.size()};<br class=""> TableData.append(GeneratorTrait.strings_begin(),GeneratorTrait.strings_end());<br class=""> Stream.EmitRecordWithBlob(TableAbbrev, Record, TableData);<br class=""><br class="">@@ -1911,8 +1893,7 @@ void ASTWriter::WriteSourceManagerBlock(<br class=""> Stream.EmitRecordWithAbbrev(SLocFileAbbrv, Record);<br class=""><br class=""> if (Content->BufferOverridden) {<br class="">- Record.clear();<br class="">- Record.push_back(SM_SLOC_BUFFER_BLOB);<br class="">+ RecordData::value_type Record[] = {SM_SLOC_BUFFER_BLOB};<br class=""> const llvm::MemoryBuffer *Buffer<br class=""> = Content->getBuffer(PP.getDiagnostics(), PP.getSourceManager());<br class=""> Stream.EmitRecordWithBlob(SLocBufferBlobAbbrv, Record,<br class="">@@ -1931,8 +1912,7 @@ void ASTWriter::WriteSourceManagerBlock(<br class=""> const char *Name = Buffer->getBufferIdentifier();<br class=""> Stream.EmitRecordWithBlob(SLocBufferAbbrv, Record,<br class=""> StringRef(Name, strlen(Name) + 1));<br class="">- Record.clear();<br class="">- Record.push_back(SM_SLOC_BUFFER_BLOB);<br class="">+ RecordData::value_type Record[] = {SM_SLOC_BUFFER_BLOB};<br class=""> Stream.EmitRecordWithBlob(SLocBufferBlobAbbrv, Record,<br class=""> StringRef(Buffer->getBufferStart(),<br class=""> Buffer->getBufferSize() + 1));<br class="">@@ -1972,13 +1952,13 @@ void ASTWriter::WriteSourceManagerBlock(<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 16)); // total size<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // offsets<br class=""> unsigned SLocOffsetsAbbrev = Stream.EmitAbbrev(Abbrev);<br class="">-<br class="">- Record.clear();<br class="">- Record.push_back(SOURCE_LOCATION_OFFSETS);<br class="">- Record.push_back(SLocEntryOffsets.size());<br class="">- Record.push_back(SourceMgr.getNextLocalOffset() - 1); // skip dummy<br class="">- Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, bytes(SLocEntryOffsets));<br class="">-<br class="">+ {<br class="">+ RecordData::value_type Record[] = {<br class="">+ SOURCE_LOCATION_OFFSETS, SLocEntryOffsets.size(),<br class="">+ SourceMgr.getNextLocalOffset() - 1 /* skip dummy */};<br class="">+ Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record,<br class="">+ bytes(SLocEntryOffsets));<br class="">+ }<br class=""> // Write the source location entry preloads array, telling the AST<br class=""> // reader which source locations entries it should load eagerly.<br class=""> Stream.EmitRecord(SOURCE_LOCATION_PRELOADS, PreloadSLocs);<br class="">@@ -2064,9 +2044,8 @@ void ASTWriter::WritePreprocessor(const<br class=""><br class=""> // If the preprocessor __COUNTER__ value has been bumped, remember it.<br class=""> if (PP.getCounterValue() != 0) {<br class="">- Record.push_back(PP.getCounterValue());<br class="">+ RecordData::value_type Record[] = {PP.getCounterValue()};<br class=""> Stream.EmitRecord(PP_COUNTER_VALUE, Record);<br class="">- Record.clear();<br class=""> }<br class=""><br class=""> // Enter the preprocessor block.<br class="">@@ -2232,12 +2211,11 @@ void ASTWriter::WritePreprocessor(const<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));<br class=""><br class=""> unsigned MacroOffsetAbbrev = Stream.EmitAbbrev(Abbrev);<br class="">- Record.clear();<br class="">- Record.push_back(MACRO_OFFSET);<br class="">- Record.push_back(MacroOffsets.size());<br class="">- Record.push_back(FirstMacroID - NUM_PREDEF_MACRO_IDS);<br class="">- Stream.EmitRecordWithBlob(MacroOffsetAbbrev, Record,<br class="">- bytes(MacroOffsets));<br class="">+ {<br class="">+ RecordData::value_type Record[] = {MACRO_OFFSET, MacroOffsets.size(),<br class="">+ FirstMacroID - NUM_PREDEF_MACRO_IDS};<br class="">+ Stream.EmitRecordWithBlob(MacroOffsetAbbrev, Record, bytes(MacroOffsets));<br class="">+ }<br class=""> }<br class=""><br class=""> void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) {<br class="">@@ -2331,9 +2309,9 @@ void ASTWriter::WritePreprocessorDetail(<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));<br class=""> unsigned PPEOffsetAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class="">- Record.clear();<br class="">- Record.push_back(PPD_ENTITIES_OFFSETS);<br class="">- Record.push_back(FirstPreprocessorEntityID - NUM_PREDEF_PP_ENTITY_IDS);<br class="">+ RecordData::value_type Record[] = {PPD_ENTITIES_OFFSETS,<br class="">+ FirstPreprocessorEntityID -<br class="">+ NUM_PREDEF_PP_ENTITY_IDS};<br class=""> Stream.EmitRecordWithBlob(PPEOffsetAbbrev, Record,<br class=""> bytes(PreprocessedEntityOffsets));<br class=""> }<br class="">@@ -2460,9 +2438,9 @@ void ASTWriter::WriteSubmodules(Module *<br class=""> unsigned ConflictAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class=""> // Write the submodule metadata block.<br class="">- RecordData Record;<br class="">- Record.push_back(getNumberOfModules(WritingModule));<br class="">- Record.push_back(FirstSubmoduleID - NUM_PREDEF_SUBMODULE_IDS);<br class="">+ RecordData::value_type Record[] = {getNumberOfModules(WritingModule),<br class="">+ FirstSubmoduleID -<br class="">+ NUM_PREDEF_SUBMODULE_IDS};<br class=""> Stream.EmitRecord(SUBMODULE_METADATA, Record);<br class=""><br class=""> // Write all of the submodules.<br class="">@@ -2472,45 +2450,37 @@ void ASTWriter::WriteSubmodules(Module *<br class=""> Module *Mod = Q.front();<br class=""> Q.pop();<br class=""> unsigned ID = getSubmoduleID(Mod);<br class="">-<br class="">- // Emit the definition of the block.<br class="">- Record.clear();<br class="">- Record.push_back(SUBMODULE_DEFINITION);<br class="">- Record.push_back(ID);<br class="">+<br class="">+ uint64_t ParentID = 0;<br class=""> if (Mod->Parent) {<br class=""> assert(SubmoduleIDs[Mod->Parent] && "Submodule parent not written?");<br class="">- Record.push_back(SubmoduleIDs[Mod->Parent]);<br class="">- } else {<br class="">- Record.push_back(0);<br class="">+ ParentID = SubmoduleIDs[Mod->Parent];<br class=""> }<br class="">- Record.push_back(Mod->IsFramework);<br class="">- Record.push_back(Mod->IsExplicit);<br class="">- Record.push_back(Mod->IsSystem);<br class="">- Record.push_back(Mod->IsExternC);<br class="">- Record.push_back(Mod->InferSubmodules);<br class="">- Record.push_back(Mod->InferExplicitSubmodules);<br class="">- Record.push_back(Mod->InferExportWildcard);<br class="">- Record.push_back(Mod->ConfigMacrosExhaustive);<br class="">- Stream.EmitRecordWithBlob(DefinitionAbbrev, Record, Mod->Name);<br class="">-<br class="">+<br class="">+ // Emit the definition of the block.<br class="">+ {<br class="">+ RecordData::value_type Record[] = {<br class="">+ SUBMODULE_DEFINITION, ID, ParentID, Mod->IsFramework, Mod->IsExplicit,<br class="">+ Mod->IsSystem, Mod->IsExternC, Mod->InferSubmodules,<br class="">+ Mod->InferExplicitSubmodules, Mod->InferExportWildcard,<br class="">+ Mod->ConfigMacrosExhaustive};<br class="">+ Stream.EmitRecordWithBlob(DefinitionAbbrev, Record, Mod->Name);<br class="">+ }<br class="">+<br class=""> // Emit the requirements.<br class=""> for (const auto &R : Mod->Requirements) {<br class="">- Record.clear();<br class="">- Record.push_back(SUBMODULE_REQUIRES);<br class="">- Record.push_back(R.second);<br class="">+ RecordData::value_type Record[] = {SUBMODULE_REQUIRES, R.second};<br class=""> Stream.EmitRecordWithBlob(RequiresAbbrev, Record, R.first);<br class=""> }<br class=""><br class=""> // Emit the umbrella header, if there is one.<br class=""> if (auto UmbrellaHeader = Mod->getUmbrellaHeader()) {<br class="">- Record.clear();<br class="">- Record.push_back(SUBMODULE_UMBRELLA_HEADER);<br class="">+ RecordData::value_type Record[] = {SUBMODULE_UMBRELLA_HEADER};<br class=""> Stream.EmitRecordWithBlob(UmbrellaAbbrev, Record,<br class=""> UmbrellaHeader.NameAsWritten);<br class=""> } else if (auto UmbrellaDir = Mod->getUmbrellaDir()) {<br class="">- Record.clear();<br class="">- Record.push_back(SUBMODULE_UMBRELLA_DIR);<br class="">- Stream.EmitRecordWithBlob(UmbrellaDirAbbrev, Record,<br class="">+ RecordData::value_type Record[] = {SUBMODULE_UMBRELLA_DIR};<br class="">+ Stream.EmitRecordWithBlob(UmbrellaDirAbbrev, Record,<br class=""> UmbrellaDir.NameAsWritten);<br class=""> }<br class=""><br class="">@@ -2528,8 +2498,7 @@ void ASTWriter::WriteSubmodules(Module *<br class=""> {SUBMODULE_EXCLUDED_HEADER, ExcludedHeaderAbbrev, Module::HK_Excluded}<br class=""> };<br class=""> for (auto &HL : HeaderLists) {<br class="">- Record.clear();<br class="">- Record.push_back(HL.RecordKind);<br class="">+ RecordData::value_type Record[] = {HL.RecordKind};<br class=""> for (auto &H : Mod->Headers[HL.HeaderKind])<br class=""> Stream.EmitRecordWithBlob(HL.Abbrev, Record, H.NameAsWritten);<br class=""> }<br class="">@@ -2537,15 +2506,14 @@ void ASTWriter::WriteSubmodules(Module *<br class=""> // Emit the top headers.<br class=""> {<br class=""> auto TopHeaders = Mod->getTopHeaders(PP->getFileManager());<br class="">- Record.clear();<br class="">- Record.push_back(SUBMODULE_TOPHEADER);<br class="">+ RecordData::value_type Record[] = {SUBMODULE_TOPHEADER};<br class=""> for (auto *H : TopHeaders)<br class=""> Stream.EmitRecordWithBlob(TopHeaderAbbrev, Record, H->getName());<br class=""> }<br class=""><br class=""> // Emit the imports.<br class=""> if (!Mod->Imports.empty()) {<br class="">- Record.clear();<br class="">+ RecordData Record;<br class=""> for (auto *I : Mod->Imports)<br class=""> Record.push_back(getSubmoduleID(I));<br class=""> Stream.EmitRecord(SUBMODULE_IMPORTS, Record);<br class="">@@ -2553,7 +2521,7 @@ void ASTWriter::WriteSubmodules(Module *<br class=""><br class=""> // Emit the exports.<br class=""> if (!Mod->Exports.empty()) {<br class="">- Record.clear();<br class="">+ RecordData Record;<br class=""> for (const auto &E : Mod->Exports) {<br class=""> // FIXME: This may fail; we don't require that all exported modules<br class=""> // are local or imported.<br class="">@@ -2569,26 +2537,23 @@ void ASTWriter::WriteSubmodules(Module *<br class=""><br class=""> // Emit the link libraries.<br class=""> for (const auto &LL : Mod->LinkLibraries) {<br class="">- Record.clear();<br class="">- Record.push_back(SUBMODULE_LINK_LIBRARY);<br class="">- Record.push_back(LL.IsFramework);<br class="">+ RecordData::value_type Record[] = {SUBMODULE_LINK_LIBRARY,<br class="">+ LL.IsFramework};<br class=""> Stream.EmitRecordWithBlob(LinkLibraryAbbrev, Record, LL.Library);<br class=""> }<br class=""><br class=""> // Emit the conflicts.<br class=""> for (const auto &C : Mod->Conflicts) {<br class="">- Record.clear();<br class="">- Record.push_back(SUBMODULE_CONFLICT);<br class=""> // FIXME: This may fail; we don't require that all conflicting modules<br class=""> // are local or imported.<br class="">- Record.push_back(getSubmoduleID(C.Other));<br class="">+ RecordData::value_type Record[] = {SUBMODULE_CONFLICT,<br class="">+ getSubmoduleID(C.Other)};<br class=""> Stream.EmitRecordWithBlob(ConflictAbbrev, Record, C.Message);<br class=""> }<br class=""><br class=""> // Emit the configuration macros.<br class=""> for (const auto &CM : Mod->ConfigMacros) {<br class="">- Record.clear();<br class="">- Record.push_back(SUBMODULE_CONFIG_MACRO);<br class="">+ RecordData::value_type Record[] = {SUBMODULE_CONFIG_MACRO};<br class=""> Stream.EmitRecordWithBlob(ConfigMacroAbbrev, Record, CM);<br class=""> }<br class=""><br class="">@@ -2670,8 +2635,6 @@ void ASTWriter::WriteCXXCtorInitializers<br class=""> if (CXXCtorInitializersOffsets.empty())<br class=""> return;<br class=""><br class="">- RecordData Record;<br class="">-<br class=""> // Create a blob abbreviation for the C++ ctor initializer offsets.<br class=""> using namespace llvm;<br class=""><br class="">@@ -2682,9 +2645,8 @@ void ASTWriter::WriteCXXCtorInitializers<br class=""> unsigned CtorInitializersOffsetAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class=""> // Write the base specifier offsets table.<br class="">- Record.clear();<br class="">- Record.push_back(CXX_CTOR_INITIALIZERS_OFFSETS);<br class="">- Record.push_back(CXXCtorInitializersOffsets.size());<br class="">+ RecordData::value_type Record[] = {CXX_CTOR_INITIALIZERS_OFFSETS,<br class="">+ CXXCtorInitializersOffsets.size()};<br class=""> Stream.EmitRecordWithBlob(CtorInitializersOffsetAbbrev, Record,<br class=""> bytes(CXXCtorInitializersOffsets));<br class=""> }<br class="">@@ -2693,8 +2655,6 @@ void ASTWriter::WriteCXXBaseSpecifiersOf<br class=""> if (CXXBaseSpecifiersOffsets.empty())<br class=""> return;<br class=""><br class="">- RecordData Record;<br class="">-<br class=""> // Create a blob abbreviation for the C++ base specifiers offsets.<br class=""> using namespace llvm;<br class=""><br class="">@@ -2705,9 +2665,8 @@ void ASTWriter::WriteCXXBaseSpecifiersOf<br class=""> unsigned BaseSpecifierOffsetAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class=""> // Write the base specifier offsets table.<br class="">- Record.clear();<br class="">- Record.push_back(CXX_BASE_SPECIFIER_OFFSETS);<br class="">- Record.push_back(CXXBaseSpecifiersOffsets.size());<br class="">+ RecordData::value_type Record[] = {CXX_BASE_SPECIFIER_OFFSETS,<br class="">+ CXXBaseSpecifiersOffsets.size()};<br class=""> Stream.EmitRecordWithBlob(BaseSpecifierOffsetAbbrev, Record,<br class=""> bytes(CXXBaseSpecifiersOffsets));<br class=""> }<br class="">@@ -2778,8 +2737,6 @@ uint64_t ASTWriter::WriteDeclContextLexi<br class=""> return 0;<br class=""><br class=""> uint64_t Offset = Stream.GetCurrentBitNo();<br class="">- RecordData Record;<br class="">- Record.push_back(DECL_CONTEXT_LEXICAL);<br class=""> SmallVector<uint32_t, 128> KindDeclPairs;<br class=""> for (const auto *D : DC->decls()) {<br class=""> KindDeclPairs.push_back(D->getKind());<br class="">@@ -2787,6 +2744,7 @@ uint64_t ASTWriter::WriteDeclContextLexi<br class=""> }<br class=""><br class=""> ++NumLexicalDeclContexts;<br class="">+ RecordData::value_type Record[] = {DECL_CONTEXT_LEXICAL};<br class=""> Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record,<br class=""> bytes(KindDeclPairs));<br class=""> return Offset;<br class="">@@ -2794,7 +2752,6 @@ uint64_t ASTWriter::WriteDeclContextLexi<br class=""><br class=""> void ASTWriter::WriteTypeDeclOffsets() {<br class=""> using namespace llvm;<br class="">- RecordData Record;<br class=""><br class=""> // Write the type offsets array<br class=""> BitCodeAbbrev *Abbrev = new BitCodeAbbrev();<br class="">@@ -2803,11 +2760,11 @@ void ASTWriter::WriteTypeDeclOffsets() {<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // base type index<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // types block<br class=""> unsigned TypeOffsetAbbrev = Stream.EmitAbbrev(Abbrev);<br class="">- Record.clear();<br class="">- Record.push_back(TYPE_OFFSET);<br class="">- Record.push_back(TypeOffsets.size());<br class="">- Record.push_back(FirstTypeID - NUM_PREDEF_TYPE_IDS);<br class="">- Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, bytes(TypeOffsets));<br class="">+ {<br class="">+ RecordData::value_type Record[] = {TYPE_OFFSET, TypeOffsets.size(),<br class="">+ FirstTypeID - NUM_PREDEF_TYPE_IDS};<br class="">+ Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, bytes(TypeOffsets));<br class="">+ }<br class=""><br class=""> // Write the declaration offsets array<br class=""> Abbrev = new BitCodeAbbrev();<br class="">@@ -2816,16 +2773,15 @@ void ASTWriter::WriteTypeDeclOffsets() {<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // base decl ID<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // declarations block<br class=""> unsigned DeclOffsetAbbrev = Stream.EmitAbbrev(Abbrev);<br class="">- Record.clear();<br class="">- Record.push_back(DECL_OFFSET);<br class="">- Record.push_back(DeclOffsets.size());<br class="">- Record.push_back(FirstDeclID - NUM_PREDEF_DECL_IDS);<br class="">- Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, bytes(DeclOffsets));<br class="">+ {<br class="">+ RecordData::value_type Record[] = {DECL_OFFSET, DeclOffsets.size(),<br class="">+ FirstDeclID - NUM_PREDEF_DECL_IDS};<br class="">+ Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, bytes(DeclOffsets));<br class="">+ }<br class=""> }<br class=""><br class=""> void ASTWriter::WriteFileDeclIDsMap() {<br class=""> using namespace llvm;<br class="">- RecordData Record;<br class=""><br class=""> SmallVector<std::pair<FileID, DeclIDInFileInfo *>, 64> SortedFileDeclIDs(<br class=""> FileDeclIDs.begin(), FileDeclIDs.end());<br class="">@@ -2846,8 +2802,8 @@ void ASTWriter::WriteFileDeclIDsMap() {<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));<br class=""> unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev);<br class="">- Record.push_back(FILE_SORTED_DECLS);<br class="">- Record.push_back(FileGroupedDeclIDs.size());<br class="">+ RecordData::value_type Record[] = {FILE_SORTED_DECLS,<br class="">+ FileGroupedDeclIDs.size()};<br class=""> Stream.EmitRecordWithBlob(AbbrevCode, Record, bytes(FileGroupedDeclIDs));<br class=""> }<br class=""><br class="">@@ -3057,11 +3013,11 @@ void ASTWriter::WriteSelectors(Sema &Sem<br class=""> unsigned MethodPoolAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class=""> // Write the method pool<br class="">- RecordData Record;<br class="">- Record.push_back(METHOD_POOL);<br class="">- Record.push_back(BucketOffset);<br class="">- Record.push_back(NumTableEntries);<br class="">- Stream.EmitRecordWithBlob(MethodPoolAbbrev, Record, MethodPool);<br class="">+ {<br class="">+ RecordData::value_type Record[] = {METHOD_POOL, BucketOffset,<br class="">+ NumTableEntries};<br class="">+ Stream.EmitRecordWithBlob(MethodPoolAbbrev, Record, MethodPool);<br class="">+ }<br class=""><br class=""> // Create a blob abbreviation for the selector table offsets.<br class=""> Abbrev = new BitCodeAbbrev();<br class="">@@ -3072,12 +3028,13 @@ void ASTWriter::WriteSelectors(Sema &Sem<br class=""> unsigned SelectorOffsetAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class=""> // Write the selector offsets table.<br class="">- Record.clear();<br class="">- Record.push_back(SELECTOR_OFFSETS);<br class="">- Record.push_back(SelectorOffsets.size());<br class="">- Record.push_back(FirstSelectorID - NUM_PREDEF_SELECTOR_IDS);<br class="">- Stream.EmitRecordWithBlob(SelectorOffsetAbbrev, Record,<br class="">- bytes(SelectorOffsets));<br class="">+ {<br class="">+ RecordData::value_type Record[] = {<br class="">+ SELECTOR_OFFSETS, SelectorOffsets.size(),<br class="">+ FirstSelectorID - NUM_PREDEF_SELECTOR_IDS};<br class="">+ Stream.EmitRecordWithBlob(SelectorOffsetAbbrev, Record,<br class="">+ bytes(SelectorOffsets));<br class="">+ }<br class=""> }<br class=""> }<br class=""><br class="">@@ -3347,9 +3304,7 @@ void ASTWriter::WriteIdentifierTable(Pre<br class=""> unsigned IDTableAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class=""> // Write the identifier table<br class="">- RecordData Record;<br class="">- Record.push_back(IDENTIFIER_TABLE);<br class="">- Record.push_back(BucketOffset);<br class="">+ RecordData::value_type Record[] = {IDENTIFIER_TABLE, BucketOffset};<br class=""> Stream.EmitRecordWithBlob(IDTableAbbrev, Record, IdentifierTable);<br class=""> }<br class=""><br class="">@@ -3365,11 +3320,10 @@ void ASTWriter::WriteIdentifierTable(Pre<br class=""> for (unsigned I = 0, N = IdentifierOffsets.size(); I != N; ++I)<br class=""> assert(IdentifierOffsets[I] && "Missing identifier offset?");<br class=""> #endif<br class="">-<br class="">- RecordData Record;<br class="">- Record.push_back(IDENTIFIER_OFFSET);<br class="">- Record.push_back(IdentifierOffsets.size());<br class="">- Record.push_back(FirstIdentID - NUM_PREDEF_IDENT_IDS);<br class="">+<br class="">+ RecordData::value_type Record[] = {IDENTIFIER_OFFSET,<br class="">+ IdentifierOffsets.size(),<br class="">+ FirstIdentID - NUM_PREDEF_IDENT_IDS};<br class=""> Stream.EmitRecordWithBlob(IdentifierOffsetAbbrev, Record,<br class=""> bytes(IdentifierOffsets));<br class=""><br class="">@@ -3785,8 +3739,7 @@ uint64_t ASTWriter::WriteDeclContextVisi<br class=""> GenerateNameLookupTable(DC, LookupTable);<br class=""><br class=""> // Write the lookup table<br class="">- RecordData Record;<br class="">- Record.push_back(DECL_CONTEXT_VISIBLE);<br class="">+ RecordData::value_type Record[] = {DECL_CONTEXT_VISIBLE};<br class=""> Stream.EmitRecordWithBlob(DeclContextVisibleLookupAbbrev, Record,<br class=""> LookupTable);<br class=""> ++NumVisibleDeclContexts;<br class="">@@ -3817,16 +3770,13 @@ void ASTWriter::WriteDeclContextVisibleU<br class=""> DC = cast<DeclContext>(Chain->getKeyDeclaration(cast<Decl>(DC)));<br class=""><br class=""> // Write the lookup table<br class="">- RecordData Record;<br class="">- Record.push_back(UPDATE_VISIBLE);<br class="">- Record.push_back(getDeclID(cast<Decl>(DC)));<br class="">+ RecordData::value_type Record[] = {UPDATE_VISIBLE, getDeclID(cast<Decl>(DC))};<br class=""> Stream.EmitRecordWithBlob(UpdateVisibleAbbrev, Record, LookupTable);<br class=""> }<br class=""><br class=""> /// \brief Write an FP_PRAGMA_OPTIONS block for the given FPOptions.<br class=""> void ASTWriter::WriteFPPragmaOptions(const FPOptions &Opts) {<br class="">- RecordData Record;<br class="">- Record.push_back(Opts.fp_contract);<br class="">+ RecordData::value_type Record[] = {Opts.fp_contract};<br class=""> Stream.EmitRecord(FP_PRAGMA_OPTIONS, Record);<br class=""> }<br class=""><br class="">@@ -3883,14 +3833,12 @@ void ASTWriter::WriteObjCCategories() {<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // # of entries<br class=""> Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));<br class=""> unsigned AbbrevID = Stream.EmitAbbrev(Abbrev);<br class="">-<br class="">- RecordData Record;<br class="">- Record.push_back(OBJC_CATEGORIES_MAP);<br class="">- Record.push_back(CategoriesMap.size());<br class="">- Stream.EmitRecordWithBlob(AbbrevID, Record,<br class="">- reinterpret_cast<char*>(CategoriesMap.data()),<br class="">+<br class="">+ RecordData::value_type Record[] = {OBJC_CATEGORIES_MAP, CategoriesMap.size()};<br class="">+ Stream.EmitRecordWithBlob(AbbrevID, Record,<br class="">+ reinterpret_cast<char *>(CategoriesMap.data()),<br class=""> CategoriesMap.size() * sizeof(ObjCCategoriesInfo));<br class="">-<br class="">+<br class=""> // Emit the category lists.<br class=""> Stream.EmitRecord(OBJC_CATEGORIES, Categories);<br class=""> }<br class="">@@ -3987,7 +3935,7 @@ void ASTWriter::AddPath(StringRef Path,<br class=""> AddString(FilePath, Record);<br class=""> }<br class=""><br class="">-void ASTWriter::EmitRecordWithPath(unsigned Abbrev, RecordDataImpl &Record,<br class="">+void ASTWriter::EmitRecordWithPath(unsigned Abbrev, RecordDataRef Record,<br class=""> <span class="Apple-converted-space"> </span>StringRef Path) {<br class=""> SmallString<128> FilePath(Path);<br class=""> PreparePathForOutput(FilePath);<br class="">@@ -4250,14 +4198,14 @@ void ASTWriter::WriteASTCore(Sema &SemaR<br class=""> WriteControlBlock(PP, Context, isysroot, OutputFile);<br class=""><br class=""> // Write the remaining AST contents.<br class="">- RecordData Record;<br class=""> Stream.EnterSubblock(AST_BLOCK_ID, 5);<br class=""><br class=""> // This is so that older clang versions, before the introduction<br class=""> // of the control block, can read and reject the newer PCH format.<br class="">- Record.clear();<br class="">- Record.push_back(VERSION_MAJOR);<br class="">- Stream.EmitRecord(METADATA_OLD_FORMAT, Record);<br class="">+ {<br class="">+ RecordData Record = {VERSION_MAJOR};<br class="">+ Stream.EmitRecord(METADATA_OLD_FORMAT, Record);<br class="">+ }<br class=""><br class=""> // Create a lexical update block containing all of the declarations in the<br class=""> // translation unit that do not come from other AST files.<br class="">@@ -4274,11 +4222,12 @@ void ASTWriter::WriteASTCore(Sema &SemaR<br class=""> Abv->Add(llvm::BitCodeAbbrevOp(TU_UPDATE_LEXICAL));<br class=""> Abv->Add(llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Blob));<br class=""> unsigned TuUpdateLexicalAbbrev = Stream.EmitAbbrev(Abv);<br class="">- Record.clear();<br class="">- Record.push_back(TU_UPDATE_LEXICAL);<br class="">- Stream.EmitRecordWithBlob(TuUpdateLexicalAbbrev, Record,<br class="">- bytes(NewGlobalKindDeclPairs));<br class="">-<br class="">+ {<br class="">+ RecordData::value_type Record[] = {TU_UPDATE_LEXICAL};<br class="">+ Stream.EmitRecordWithBlob(TuUpdateLexicalAbbrev, Record,<br class="">+ bytes(NewGlobalKindDeclPairs));<br class="">+ }<br class="">+<br class=""> // And a visible updates block for the translation unit.<br class=""> Abv = new llvm::BitCodeAbbrev();<br class=""> Abv->Add(llvm::BitCodeAbbrevOp(UPDATE_VISIBLE));<br class="">@@ -4408,8 +4357,7 @@ void ASTWriter::WriteASTCore(Sema &SemaR<br class=""> writeBaseIDOrNone(M->BaseTypeIndex, M->LocalNumTypes);<br class=""> }<br class=""> }<br class="">- Record.clear();<br class="">- Record.push_back(MODULE_OFFSET_MAP);<br class="">+ RecordData::value_type Record[] = {MODULE_OFFSET_MAP};<br class=""> Stream.EmitRecordWithBlob(ModuleOffsetMapAbbrev, Record,<br class=""> Buffer.data(), Buffer.size());<br class=""> }<br class="">@@ -4573,11 +4521,8 @@ void ASTWriter::WriteASTCore(Sema &SemaR<br class=""> WriteOptimizePragmaOptions(SemaRef);<br class=""><br class=""> // Some simple statistics<br class="">- Record.clear();<br class="">- Record.push_back(NumStatements);<br class="">- Record.push_back(NumMacros);<br class="">- Record.push_back(NumLexicalDeclContexts);<br class="">- Record.push_back(NumVisibleDeclContexts);<br class="">+ RecordData::value_type Record[] = {<br class="">+ NumStatements, NumMacros, NumLexicalDeclContexts, NumVisibleDeclContexts};<br class=""> Stream.EmitRecord(STATISTICS, Record);<br class=""> Stream.ExitBlock();<br class=""> }<br class=""><br class="">Modified: cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp?rev=247233&r1=247232&r2=247233&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp?rev=247233&r1=247232&r2=247233&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp (original)<br class="">+++ cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp Wed Sep 9 20:46:39 2015<br class="">@@ -757,9 +757,7 @@ void GlobalModuleIndexBuilder::writeInde<br class=""> unsigned IDTableAbbrev = Stream.EmitAbbrev(Abbrev);<br class=""><br class=""> // Write the identifier table<br class="">- Record.clear();<br class="">- Record.push_back(IDENTIFIER_INDEX);<br class="">- Record.push_back(BucketOffset);<br class="">+ uint64_t Record[] = {IDENTIFIER_INDEX, BucketOffset};<br class=""> Stream.EmitRecordWithBlob(IDTableAbbrev, Record, IdentifierTable);<br class=""> }<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">cfe-commits mailing list<br class=""><a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a></blockquote></div></div></blockquote></div><br class=""></body></html>