Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
Add indexing infrastructure for Swift's read and modify accessors.
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmccall committed Jul 23, 2018
1 parent a0e59b0 commit 78aa734
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/clang/Index/IndexSymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ enum class SymbolSubKind : uint8_t {
SwiftAccessorDidSet,
SwiftAccessorAddressor,
SwiftAccessorMutableAddressor,
SwiftAccessorRead,
SwiftAccessorModify,

SwiftExtensionOfStruct,
SwiftExtensionOfClass,
Expand Down
2 changes: 2 additions & 0 deletions include/indexstore/indexstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ typedef enum {
INDEXSTORE_SYMBOL_SUBKIND_SWIFTSUBSCRIPT = 1011,
INDEXSTORE_SYMBOL_SUBKIND_SWIFTASSOCIATEDTYPE = 1012,
INDEXSTORE_SYMBOL_SUBKIND_SWIFTGENERICTYPEPARAM = 1013,
INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORREAD = 1014,
INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMODIFY = 1015,
} indexstore_symbol_subkind_t;

typedef enum {
Expand Down
8 changes: 8 additions & 0 deletions lib/Index/IndexDataStoreUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ SymbolSubKind index::getSymbolSubKind(indexstore_symbol_subkind_t K) {
return SymbolSubKind::SwiftAccessorAddressor;
case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMUTABLEADDRESSOR:
return SymbolSubKind::SwiftAccessorMutableAddressor;
case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORREAD:
return SymbolSubKind::SwiftAccessorRead;
case INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMODIFY:
return SymbolSubKind::SwiftAccessorModify;
case INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFSTRUCT:
return SymbolSubKind::SwiftExtensionOfStruct;
case INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFCLASS:
Expand Down Expand Up @@ -269,6 +273,10 @@ indexstore_symbol_subkind_t index::getIndexStoreSubKind(SymbolSubKind K) {
return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORADDRESSOR;
case SymbolSubKind::SwiftAccessorMutableAddressor:
return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMUTABLEADDRESSOR;
case SymbolSubKind::SwiftAccessorRead:
return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORREAD;
case SymbolSubKind::SwiftAccessorModify:
return INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORMODIFY;
case SymbolSubKind::SwiftExtensionOfStruct:
return INDEXSTORE_SYMBOL_SUBKIND_SWIFTEXTENSIONOFSTRUCT;
case SymbolSubKind::SwiftExtensionOfClass:
Expand Down
2 changes: 2 additions & 0 deletions lib/Index/IndexSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ StringRef index::getSymbolSubKindString(SymbolSubKind K) {
case SymbolSubKind::SwiftAccessorDidSet: return "acc-didset";
case SymbolSubKind::SwiftAccessorAddressor: return "acc-addr";
case SymbolSubKind::SwiftAccessorMutableAddressor: return "acc-mutaddr";
case SymbolSubKind::SwiftAccessorRead: return "acc-read";
case SymbolSubKind::SwiftAccessorModify: return "acc-modify";
case SymbolSubKind::SwiftExtensionOfStruct: return "ext-struct";
case SymbolSubKind::SwiftExtensionOfClass: return "ext-class";
case SymbolSubKind::SwiftExtensionOfEnum: return "ext-enum";
Expand Down

0 comments on commit 78aa734

Please sign in to comment.