From fa698380e2dade9e0ba5c8d6bf0fb0c283ad9c4f Mon Sep 17 00:00:00 2001 From: Pavel Avgustinov Date: Mon, 24 Sep 2018 18:18:30 +0100 Subject: [PATCH] C++ definitions: Ignore type mentions of class inatantiations. We currently erroneously keep mentions of class instantiations, which can lead to bad performance on template-heavy code bases. We never want to link those anyway, so we can simply suppress them. --- cpp/ql/src/definitions.qll | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/ql/src/definitions.qll b/cpp/ql/src/definitions.qll index 9ae818eecb56..b067c22040ce 100644 --- a/cpp/ql/src/definitions.qll +++ b/cpp/ql/src/definitions.qll @@ -102,7 +102,8 @@ private predicate constructorCallStartLoc(ConstructorCall cc, File f, int line, /** * Holds if `f`, `line`, `column` indicate the start character - * of `tm`, which mentions `t`. + * of `tm`, which mentions `t`. Type mentions for instantiations + * are filtered out. */ private predicate typeMentionStartLoc(TypeMention tm, Type t, File f, int line, int column) { exists(Location l | @@ -111,7 +112,8 @@ private predicate typeMentionStartLoc(TypeMention tm, Type t, File f, int line, l.getStartLine() = line and l.getStartColumn() = column ) and - t = tm.getMentionedType() + t = tm.getMentionedType() and + not t instanceof ClassTemplateInstantiation } /**