File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ struct ExternalSourceLocs {
5050
5151 unsigned BufferID = 0 ;
5252 SourceLoc Loc;
53- SmallVector <CharSourceRange, 4 > DocRanges;
53+ ArrayRef <CharSourceRange> DocRanges;
5454};
5555
5656class BasicSourceFileInfo {
Original file line number Diff line number Diff line change @@ -653,9 +653,14 @@ const ExternalSourceLocs *Decl::getSerializedLocs() const {
653653 auto *Result = getASTContext ().Allocate <ExternalSourceLocs>();
654654 Result->BufferID = BufferID;
655655 Result->Loc = ResolveLoc (RawLocs->Loc );
656- for (auto &Range : RawLocs->DocRanges ) {
657- Result->DocRanges .emplace_back (ResolveLoc (Range.first ), Range.second );
656+
657+ auto DocRanges = getASTContext ().AllocateUninitialized <CharSourceRange>(RawLocs->DocRanges .size ());
658+ for (auto I : indices (RawLocs->DocRanges )) {
659+ auto &Range = RawLocs->DocRanges [I];
660+ DocRanges[I] = CharSourceRange (ResolveLoc (Range.first ), Range.second );
658661 }
662+ Result->DocRanges = DocRanges;
663+
659664 Context.setExternalSourceLocs (this , Result);
660665 return Result;
661666}
You can’t perform that action at this time.
0 commit comments