C++: Remove TC from 'Element.getRootCause'.

This commit is contained in:
Mathias Vorreiter Pedersen
2022-04-11 15:27:10 +01:00
parent 626770aaab
commit e86b6b182f

View File

@@ -109,10 +109,7 @@ class Element extends ElementBase {
then
exists(MacroInvocation mi |
this = mi.getAGeneratedElement() and
not exists(MacroInvocation closer |
this = closer.getAGeneratedElement() and
mi = closer.getParentInvocation+()
) and
not hasCloserMacroInvocation(this, mi) and
result = mi.getMacro()
)
else result = this
@@ -236,6 +233,14 @@ class Element extends ElementBase {
}
}
pragma[noinline]
private predicate hasCloserMacroInvocation(Element elem, MacroInvocation mi) {
exists(MacroInvocation closer |
elem = closer.getAGeneratedElement() and
mi = closer.getParentInvocation()
)
}
private predicate isFromTemplateInstantiationRec(Element e, Element instantiation) {
instantiation.(Function).isConstructedFrom(_) and
e = instantiation