зеркало из https://github.com/github/codeql.git
Merge pull request #16337 from MathiasVP/cache-second-level-scope
DataFlow: Cache `getSecondLevelScope`
This commit is contained in:
Коммит
6147a38bea
|
@ -1119,9 +1119,10 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
|
|||
|
||||
pragma[nomagic]
|
||||
private SndLevelScopeOption getScope(RetNodeEx ret) {
|
||||
result = SndLevelScopeOption::some(getSecondLevelScope(ret.asNode()))
|
||||
result = SndLevelScopeOption::some(getSecondLevelScopeCached(ret.asNode()))
|
||||
or
|
||||
result instanceof SndLevelScopeOption::None and not exists(getSecondLevelScope(ret.asNode()))
|
||||
result instanceof SndLevelScopeOption::None and
|
||||
not exists(getSecondLevelScopeCached(ret.asNode()))
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
|
|
|
@ -616,6 +616,9 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
|
|||
cached
|
||||
predicate forceCachingInSameStage() { any() }
|
||||
|
||||
cached
|
||||
DataFlowSecondLevelScope getSecondLevelScopeCached(Node n) { result = getSecondLevelScope(n) }
|
||||
|
||||
cached
|
||||
predicate nodeEnclosingCallable(Node n, DataFlowCallable c) { c = nodeGetEnclosingCallable(n) }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче