CPP: Speed up LeapYear.qll 'ChecksForLeapYearFunctionCall'.

This commit is contained in:
Geoffrey White
2019-07-04 15:06:05 +01:00
parent e079406a5f
commit 70b996f721

View File

@@ -194,14 +194,21 @@ class StructTmLeapYearFieldAccess extends LeapYearFieldAccess {
}
}
/**
* `Function` that includes an operation that is checking for leap year.
*/
class ChecksForLeapYearFunction extends Function {
ChecksForLeapYearFunction() {
this = any(CheckForLeapYearOperation clyo).getEnclosingFunction()
}
}
/**
* `FunctionCall` that includes an operation that is checking for leap year.
*/
class ChecksForLeapYearFunctionCall extends FunctionCall {
ChecksForLeapYearFunctionCall() {
exists(Function f, CheckForLeapYearOperation clyo | f.getACallToThisFunction() = this |
clyo.getEnclosingFunction() = f
)
this.getTarget() instanceof ChecksForLeapYearFunction
}
}