Skip to content

Commit 23cde9b

Browse files
author
Simon Barinka
committed
[SourceKit] Move the option to IndexToStore request
1 parent 3bcfc3b commit 23cde9b

File tree

10 files changed

+88
-715
lines changed

10 files changed

+88
-715
lines changed

test/SourceKit/Indexing/index_locals.swift

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
// RUN: %sourcekitd-test -req=index -req-opts=should_index_locals=1 %s -- -Xfrontend -serialize-diagnostics-path -Xfrontend %t.dia -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import %s | %sed_clean > %t.response
2-
// RUN: %diff -u %s.response %t.response
1+
// RUN: %empty-directory(%t)
2+
// RUN: %sourcekitd-test -req=index-to-store %s -index-store-path %t/idx -index-unit-output-path %t/index_locals.o -req-opts=should_index_locals=1 -- %s
3+
// RUN: c-index-test core -print-record %t/idx | %FileCheck %s
4+
35

46
func foo(a: Int, b: Double) {
57
var locVar = 1
@@ -31,3 +33,54 @@ class X {
3133
}
3234
}
3335
}
36+
37+
38+
// CHECK: function/Swift | foo(a:b:) | s:12index_locals3foo1a1bySi_SdtF | <no-cgname> | Def,Ref,Call,RelCall,RelCont - RelChild,RelCont
39+
// CHECK-NEXT: param/Swift | a | s:12index_locals3foo1a1bySi_SdtFACL_Sivp | <no-cgname> | Def,RelChild -
40+
// CHECK-NEXT: struct/Swift | Int | s:Si | <no-cgname> | Ref,RelCont -
41+
// CHECK-NEXT: param/Swift | b | s:12index_locals3foo1a1bySi_SdtFADL_Sdvp | <no-cgname> | Def,RelChild -
42+
// CHECK-NEXT: struct/Swift | Double | s:Sd | <no-cgname> | Ref,RelCont -
43+
// CHECK-NEXT: function/acc-get(local)/Swift | getter:locVar | s:12index_locals3foo1a1bySi_SdtF6locVarL_Sivg | <no-cgname> | Def,Impl,RelChild,RelAcc -
44+
// CHECK-NEXT: variable(local)/Swift | locVar | s:12index_locals3foo1a1bySi_SdtF6locVarL_Sivp | <no-cgname> | Def,RelChild - RelChild,RelAcc
45+
// CHECK-NEXT: function/acc-set(local)/Swift | setter:locVar | s:12index_locals3foo1a1bySi_SdtF6locVarL_Sivs | <no-cgname> | Def,Impl,RelChild,RelAcc -
46+
// CHECK-NEXT: function/acc-get/Swift | getter:globalVar | s:12index_locals9globalVarSivg | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelCall,RelAcc,RelCont -
47+
// CHECK-NEXT: variable/Swift | globalVar | s:12index_locals9globalVarSivp | <no-cgname> | Def,Ref,Read,RelCont - RelChild,RelAcc
48+
// CHECK-NEXT: function/acc-set/Swift | setter:globalVar | s:12index_locals9globalVarSivs | <no-cgname> | Def,Impl,RelChild,RelAcc -
49+
// CHECK-NEXT: class/Swift | A | s:12index_locals1AC | <no-cgname> | Def,Ref,RelCont - RelChild,RelBase
50+
// CHECK-NEXT: protocol/Swift | ExpressibleByIntegerLiteral | s:s27ExpressibleByIntegerLiteralP | <no-cgname> | Ref,RelBase -
51+
// CHECK-NEXT: constructor/Swift | init(integerLiteral:) | s:12index_locals1AC14integerLiteralACSi_tcfc | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelOver,RelCall,RelCont - RelChild,RelCont
52+
// CHECK-NEXT: constructor/Swift | init(integerLiteral:) | s:s27ExpressibleByIntegerLiteralP07integerD0x0cD4TypeQz_tcfc | <no-cgname> | - RelOver
53+
// CHECK-NEXT: param(local)/Swift | value | s:12index_locals1AC14integerLiteralACSi_tcfc5valueL_Sivp | <no-cgname> | Def,RelChild -
54+
// CHECK-NEXT: type-alias/Swift | IntegerLiteralType | s:s18IntegerLiteralTypea | <no-cgname> | Ref,RelCont -
55+
// CHECK-NEXT: function/Swift | bar() | s:12index_locals3baryyF | <no-cgname> | Def - RelChild,RelCall,RelCont
56+
// CHECK-NEXT: function/acc-get(local)/Swift | getter:locVar1 | s:12index_locals3baryyF7locVar1L_AA1ACvg | <no-cgname> | Def,Impl,RelChild,RelAcc -
57+
// CHECK-NEXT: variable(local)/Swift | locVar1 | s:12index_locals3baryyF7locVar1L_AA1ACvp | <no-cgname> | Def,RelChild - RelChild,RelAcc,RelCont
58+
// CHECK-NEXT: function/acc-set(local)/Swift | setter:locVar1 | s:12index_locals3baryyF7locVar1L_AA1ACvs | <no-cgname> | Def,Impl,RelChild,RelAcc -
59+
// CHECK-NEXT: function/acc-get(local)/Swift | getter:locVar2 | s:12index_locals3baryyF7locVar2L_Sivg | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelCall,RelAcc,RelCont -
60+
// CHECK-NEXT: variable(local)/Swift | locVar2 | s:12index_locals3baryyF7locVar2L_Sivp | <no-cgname> | Def,Ref,Read,RelChild,RelCont - RelChild,RelAcc
61+
// CHECK-NEXT: function/acc-set(local)/Swift | setter:locVar2 | s:12index_locals3baryyF7locVar2L_Sivs | <no-cgname> | Def,Impl,RelChild,RelAcc -
62+
// CHECK-NEXT: constructor/Swift | init(_:) | s:SdySdSicfc | <no-cgname> | Ref,Call,RelCall,RelCont -
63+
// CHECK-NEXT: function/acc-get(local)/Swift | getter:closure | s:12index_locals3baryyF7closureL_yS2i_Sitcvg | <no-cgname> | Def,Impl,RelChild,RelAcc -
64+
// CHECK-NEXT: variable(local)/Swift | closure | s:12index_locals3baryyF7closureL_yS2i_Sitcvp | <no-cgname> | Def,RelChild - RelChild,RelAcc,RelCont
65+
// CHECK-NEXT: function/acc-set(local)/Swift | setter:closure | s:12index_locals3baryyF7closureL_yS2i_Sitcvs | <no-cgname> | Def,Impl,RelChild,RelAcc -
66+
// CHECK-NEXT: param(local)/Swift | arg1 | s:12index_locals3baryyFS2i_SitcfU_4arg1L_Sivp | <no-cgname> | Def,Ref,Read,RelChild,RelCont -
67+
// CHECK-NEXT: param(local)/Swift | arg2 | s:12index_locals3baryyFS2i_SitcfU_4arg2L_Sivp | <no-cgname> | Def,RelChild -
68+
// CHECK-NEXT: function/acc-get(local)/Swift | getter:locVar3 | s:12index_locals3baryyFS2i_SitcfU_7locVar3L_Sivg | <no-cgname> | Def,Impl,RelChild,RelAcc -
69+
// CHECK-NEXT: variable(local)/Swift | locVar3 | s:12index_locals3baryyFS2i_SitcfU_7locVar3L_Sivp | <no-cgname> | Def,RelChild - RelChild,RelAcc
70+
// CHECK-NEXT: function/acc-set(local)/Swift | setter:locVar3 | s:12index_locals3baryyFS2i_SitcfU_7locVar3L_Sivs | <no-cgname> | Def,Impl,RelChild,RelAcc -
71+
// CHECK-NEXT: function/acc-get(local)/Swift | getter:expr | s:12index_locals3baryyFS2i_SitcfU_4exprL_Sivg | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelCall,RelAcc,RelCont -
72+
// CHECK-NEXT: variable(local)/Swift | expr | s:12index_locals3baryyFS2i_SitcfU_4exprL_Sivp | <no-cgname> | Def,Ref,Read,RelChild,RelCont - RelChild,RelAcc,RelCont
73+
// CHECK-NEXT: function/acc-set(local)/Swift | setter:expr | s:12index_locals3baryyFS2i_SitcfU_4exprL_Sivs | <no-cgname> | Def,Impl,RelChild,RelAcc -
74+
// CHECK-NEXT: static-method/infix-operator/Swift | +(_:_:) | s:Si1poiyS2i_SitFZ | <no-cgname> | Ref,Call,RelCall,RelCont -
75+
// CHECK-NEXT: constructor/Swift | init() | s:12index_locals1XCACycfc | <no-cgname> | Def,Impl,RelChild -
76+
// CHECK-NEXT: class/Swift | X | s:12index_locals1XC | <no-cgname> | Def - RelChild
77+
// CHECK-NEXT: instance-method/Swift | baz() | s:12index_locals1XC3bazyyF | <no-cgname> | Def,Dyn,RelChild - RelChild,RelCall,RelCont
78+
// CHECK-NEXT: function(local)/Swift | inner(_:) | s:12index_locals1XC3bazyyF5innerL_yS2iF | <no-cgname> | Def,Ref,Call,RelChild,RelCall,RelCont - RelChild,RelCont
79+
// CHECK-NEXT: param(local)/Swift | x | s:12index_locals1XC3bazyyF5innerL_yS2iF1xL_Sivp | <no-cgname> | Def,Ref,Read,RelChild,RelCont -
80+
// CHECK-NEXT: function/acc-get(local)/Swift | getter:arr | s:12index_locals1XC3bazyyF3arrL_SaySiGvg | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelCall,RelAcc,RelCont -
81+
// CHECK-NEXT: variable(local)/Swift | arr | s:12index_locals1XC3bazyyF3arrL_SaySiGvp | <no-cgname> | Def,Ref,Read,Writ,RelChild,RelCont - RelChild,RelAcc,RelCont
82+
// CHECK-NEXT: function/acc-set(local)/Swift | setter:arr | s:12index_locals1XC3bazyyF3arrL_SaySiGvs | <no-cgname> | Def,Ref,Call,Impl,RelChild,RelCall,RelAcc,RelCont -
83+
// CHECK-NEXT: constructor/Swift | init(arrayLiteral:) | s:Sa12arrayLiteralSayxGxd_tcfc | <no-cgname> | Ref,Call,Impl,RelCall,RelCont -
84+
// CHECK-NEXT: static-method/infix-operator/Swift | >(_:_:) | s:Si1goiySbSi_SitFZ | <no-cgname> | Ref,Call,RelCall,RelCont -
85+
// CHECK-NEXT: instance-method/Swift | map(_:) | s:SlsE3mapySayqd__Gqd__7ElementQzKXEKlF | <no-cgname> | Ref,Call,Dyn,RelRec,RelCall,RelCont -
86+
// CHECK-NEXT: struct/Swift | Array | s:Sa | <no-cgname> | - RelRec

0 commit comments

Comments
 (0)