Skip to content

Commit 70e3893

Browse files
committed
Return Optional<> offset from getLineColAndOffset.
1 parent bd10f2a commit 70e3893

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

include/swift/Index/IndexSymbol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct IndexSymbol : IndexRelation {
6666
SmallVector<IndexRelation, 3> Relations;
6767
unsigned line = 0;
6868
unsigned column = 0;
69-
llvm::Optional<unsigned> offset;
69+
Optional<unsigned> offset;
7070

7171
IndexSymbol() = default;
7272

lib/Index/Index.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,10 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
585585

586586
bool indexComment(const Decl *D);
587587

588-
std::tuple<unsigned, unsigned, unsigned> getLineColAndOffset(SourceLoc Loc) {
588+
std::tuple<unsigned, unsigned, Optional<unsigned>>
589+
getLineColAndOffset(SourceLoc Loc) {
589590
if (Loc.isInvalid())
590-
return std::make_tuple(0, 0, 0);
591+
return std::make_tuple(0, 0, None);
591592
auto lineAndColumn = SrcMgr.getLineAndColumn(Loc, BufferID);
592593
unsigned offset = SrcMgr.getLocOffsetInBuffer(Loc, BufferID);
593594
return std::make_tuple(lineAndColumn.first, lineAndColumn.second, offset);

0 commit comments

Comments
 (0)