mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Gardening] Do not store start/end line in SingleRawComment
The start and end lines were only used while constructing the comments, so move the line tracking into that method instead of storing it in each comment.
This commit is contained in:
@@ -879,10 +879,10 @@ SourceFile::getBasicLocsForDecl(const Decl *D) const {
|
||||
Result.SourceFilePath = SM.getDisplayNameForLoc(D->getLoc());
|
||||
|
||||
for (const auto &SRC : D->getRawComment(/*SerializedOK*/false).Comments) {
|
||||
Result.DocRanges.push_back(std::make_pair(
|
||||
SourcePosition { SRC.StartLine, SRC.StartColumn },
|
||||
SRC.Range.getByteLength())
|
||||
);
|
||||
auto LineAndCol = SM.getLineAndColumnInBuffer(SRC.Range.getStart());
|
||||
Result.DocRanges.push_back(
|
||||
std::make_pair(SourcePosition{LineAndCol.first, LineAndCol.second},
|
||||
SRC.Range.getByteLength()));
|
||||
}
|
||||
|
||||
auto setLineColumn = [&SM](SourcePosition &Home, SourceLoc Loc) {
|
||||
|
||||
Reference in New Issue
Block a user