diff --git a/glean/schema/cpp/schema.h b/glean/schema/cpp/schema.h index 56941b5b4..97256f972 100644 --- a/glean/schema/cpp/schema.h +++ b/glean/schema/cpp/schema.h @@ -13292,7 +13292,7 @@ struct XRef { } }; // struct XRef -struct FileXRefs : Predicate, std::vector>> { +struct FileXRefs : Predicate, std::set>> { static const char* GLEAN_name() { return "hack.FileXRefs"; } diff --git a/glean/schema/source/codemarkup.hack.angle b/glean/schema/source/codemarkup.hack.angle index e9ef5e77a..4ff994a44 100644 --- a/glean/schema/source/codemarkup.hack.angle +++ b/glean/schema/source/codemarkup.hack.angle @@ -41,7 +41,7 @@ predicate HackFileEntityXRefLocations: } { File, { Location, { span = Src } }, { decl = D } } where hack.FileXRefs { file = File, xrefs = XRefs }; - hack.XRef { target = { declaration = D }, ranges = Uses } = XRefs[..]; + hack.XRef { target = { declaration = D }, ranges = Uses } = elements XRefs; hack.DeclarationName D -> (hack.Name TargetName); hack.DeclarationLocation { declaration = D, file = TargetFile, span = TargetSpan }; Location = codemarkup.types.Location { TargetName, TargetFile, { span = TargetSpan }, nothing }; @@ -56,7 +56,7 @@ predicate HackFileEntityXRefSpans: } { File, Src, { decl = D } } where hack.FileXRefs { file = File, xrefs = XRefs }; - hack.XRef { target = { declaration = D }, ranges = Uses } = XRefs[..]; + hack.XRef { target = { declaration = D }, ranges = Uses } = elements XRefs; Sources = prim.relToAbsByteSpans Uses; Src = Sources[..] @@ -889,13 +889,13 @@ predicate ConvertCalleeForFileCall : { occurrence = {method = {name = N} } } = O; hack.FileXRefs { File, XRefs }; # Look for resolved occurrences with the same method name in the call - { target = {declaration = D }, ranges = Uses } = XRefs[..]; + { target = {declaration = D }, ranges = Uses } = elements XRefs; { method = { name = N } } = D; Sources = prim.relToAbsByteSpans Uses; S = Sources[..]; src.ByteSpanContains { Span, S }; # Match them with the unresolved occurrence - { target = O, ranges = OUses } = XRefs[..]; + { target = O, ranges = OUses } = elements XRefs; OSources = prim.relToAbsByteSpans OUses; S = OSources[..]; { just = { hack = { decl = D } } } = CodeCallee ) | diff --git a/glean/schema/source/hack.angle b/glean/schema/source/hack.angle index 66388cd14..dd7b0694f 100644 --- a/glean/schema/source/hack.angle +++ b/glean/schema/source/hack.angle @@ -498,7 +498,7 @@ type XRef = predicate FileXRefs : { file : src.File, - xrefs : [XRef], + xrefs : set XRef, } # Context-free information about an expression argument @@ -541,7 +541,7 @@ predicate TargetUses : stored { T, File, Uses } where hack.FileXRefs { file = File, xrefs = XRefs }; - hack.XRef { target = T, ranges = Uses } = XRefs[..] + hack.XRef { target = T, ranges = Uses } = elements XRefs # A version of 'TargetUses' with the bytespans converted from relative to # absolute offset format for convenience.