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.
This commit is contained in:
Pavel Avgustinov
2018-09-24 18:18:30 +01:00
parent 4b0ab602e7
commit fa698380e2

View File

@@ -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
}
/**