mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Further perf improvements
This commit is contained in:
@@ -287,18 +287,23 @@ private string stubQualifier(RefType t) {
|
||||
|
||||
pragma[nomagic]
|
||||
private predicate needsPackageNameHelper(RefType t, GeneratedTopLevel top, string name) {
|
||||
t.getSourceDeclaration() = [getAReferencedType(top), top].getSourceDeclaration() and
|
||||
t.getSourceDeclaration() =
|
||||
pragma[only_bind_out]([getAReferencedType(top), top].getSourceDeclaration()) and
|
||||
name = t.getName()
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private predicate describesMultipleTypes(GeneratedTopLevel top, string name) {
|
||||
2 <= strictcount(RefType t | needsPackageNameHelper(t, top, name))
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `t` may clash with another type of the same name, so should be referred to using the fully qualified name
|
||||
*/
|
||||
private predicate needsPackageName(RefType t) {
|
||||
exists(GeneratedTopLevel top, RefType other, string name |
|
||||
exists(GeneratedTopLevel top, string name |
|
||||
needsPackageNameHelper(t, top, name) and
|
||||
needsPackageNameHelper(other, top, name) and
|
||||
t != other
|
||||
describesMultipleTypes(top, name)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user