definitions.qll: Suppress multi-location links.

This commit is contained in:
Pavel Avgustinov
2019-08-25 15:59:17 +01:00
parent da29d99560
commit b9b0c3bc5d

View File

@@ -208,5 +208,13 @@ Top definitionOf(Top e, string kind) {
// It's possible we could allow a subset of these dependencies
// in future, if we're careful to ensure the above don't apply.
not e.isFromTemplateInstantiation(_)
) and (
// Some entities have many locations. This can arise for an external
// function that is frequently declared but not defined, or perhaps
// for a struct type that is declared in many places. Rather than
// letting the result set explode, we just exclude results that are
// "too ambiguous" -- we could also arbitrarily pick one location
// later on.
strictcount(result.getLocation()) < 10
)
}