diff --git a/kythe/docs/schema/schema.txt b/kythe/docs/schema/schema.txt index 558424094d..75a8766604 100644 --- a/kythe/docs/schema/schema.txt +++ b/kythe/docs/schema/schema.txt @@ -1216,6 +1216,57 @@ struct S { static int foo(); }; C cs; -------------------------------------------------------------------------------- +[[refcallthunk]] +ref/call/thunk +~~~~~~~~~~~~~~ + +Brief description:: + A *ref/call/thunk* F if A is an anchor that may allow F to be called in the + future. +Points from:: + anchors +Points toward:: + <> +Ordinals are used:: + never +See also:: + <> +Notes:: + This is an experimental definition and is expected to undergo refinement. + +This edge is meant to represent delayed calls to functions, such as when a +thread procedure is passed to a threading library. + +[kythe,C++,"In some contexts, uses of functions as values are thunks."] +-------------------------------------------------------------------------------- +//- @f defines/binding FnF +void f(); +//- @g defines/binding FnG +void g(void (*h)()); +void i() { + //- @f ref FnF + //- @"g(f)" ref/call FnG + //- // @f ref/call/thunk FnF -- currently unsupported + //- !{ @f ref/call FnF } + g(f); + //- @f ref FnF + //- // @f ref/call/thunk FnF -- currently unsupported + auto j = f; +} +-------------------------------------------------------------------------------- + +[kythe,Java,"Java method references make thunks."] +-------------------------------------------------------------------------------- +import java.util.function.Consumer; +public class E { + //- @f defines/binding FnF + void f(Object v) { } + //- @f ref FnF + //- // @"this::f" ref/call/thunk FnF -- currently unsupported + Consumer myF = this::f; +} +-------------------------------------------------------------------------------- + [[refdoc]] ref/doc ~~~~~~~ @@ -1496,8 +1547,6 @@ Points toward:: semantic nodes Ordinals are used:: never -Notes:: - This is an experimental definition and is expected to undergo refinement. [kythe,C++,"Various assignment expressions are writes"] -------------------------------------------------------------------------------- @@ -1516,6 +1565,44 @@ void f() { } -------------------------------------------------------------------------------- +[[refwritesthunk]] +ref/writes/thunk +~~~~~~~~~~~~~~~~ + +Brief description:: + A *ref/writes/thunk* B if A refers to B in an expression that is likely to + cause a later update the value of B. +Commonly arises from:: + value uses of setter functions, alias passing +Points from:: + anchors +Points toward:: + semantic nodes +Ordinals are used:: + never +See also:: + <> +Notes:: + This is an experimental definition and is expected to undergo refinement. + +[kythe,C++,"Various assignment expressions are thunkful writes"] +-------------------------------------------------------------------------------- +void f(int* x_out, int& y_out, const int& z); +void g() { + //- @x defines/binding VarX + //- @y defines/binding VarY + //- @z defines/binding VarZ + int x, y, z; + //- @x ref VarX + //- @y ref VarY + //- @z ref VarZ + //- // @x ref/writes/thunk VarX -- currently unsupported + //- // @y ref/writes/thunk VarY -- currently unsupported + //- !{ @z ref/writes/thunk VarZ } + f(&x, y, z); +} +-------------------------------------------------------------------------------- + [[satisfies]] satisfies ~~~~~~~~~