improve performance of type resolution

This commit is contained in:
Erik Krogh Kristensen
2021-05-31 07:51:11 +00:00
committed by GitHub
parent a286dc349a
commit b3e23bcc31

View File

@@ -266,12 +266,14 @@ predicate resolveTypeExpr(TypeExpr te, Type t) {
if primTypeName(te.getClassName())
then t = TPrimitive(te.getClassName())
else
exists(FileOrModule m, boolean public | qualifier(te, m, public) |
defines(m, te.getClassName(), t, public)
exists(FileOrModule m, boolean public, string clName | qualifier(te, m, public, clName) |
defines(m, clName, t, public)
)
}
private predicate qualifier(TypeExpr te, FileOrModule m, boolean public) {
pragma[noinline]
private predicate qualifier(TypeExpr te, FileOrModule m, boolean public, string clName) {
te.getClassName() = clName and
if exists(te.getModule())
then (
public = true and m = te.getModule().getResolvedModule()