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 {
50
50
51
51
unsigned BufferID = 0 ;
52
52
SourceLoc Loc;
53
- SmallVector <CharSourceRange, 4 > DocRanges;
53
+ ArrayRef <CharSourceRange> DocRanges;
54
54
};
55
55
56
56
class BasicSourceFileInfo {
Original file line number Diff line number Diff line change @@ -653,9 +653,14 @@ const ExternalSourceLocs *Decl::getSerializedLocs() const {
653
653
auto *Result = getASTContext ().Allocate <ExternalSourceLocs>();
654
654
Result->BufferID = BufferID;
655
655
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 );
658
661
}
662
+ Result->DocRanges = DocRanges;
663
+
659
664
Context.setExternalSourceLocs (this , Result);
660
665
return Result;
661
666
}
You can’t perform that action at this time.
0 commit comments