зеркало из https://github.com/github/codeql.git
C++: Simplify isStrictlyForwardGoto
We had an existing `Location.isBefore` predicate that was just right for this use case. Performance is great thanks to magic.
This commit is contained in:
Родитель
6d09a9b324
Коммит
34659422db
|
@ -180,15 +180,7 @@ cached private module Cached {
|
|||
|
||||
/** Holds if `goto` jumps strictly forward in the program text. */
|
||||
private predicate isStrictlyForwardGoto(GotoStmt goto) {
|
||||
exists(string gotoFile, int gotoLine, string targetFile, int targetLine |
|
||||
goto.getLocation().hasLocationInfo(gotoFile, gotoLine, _, _, _) and
|
||||
goto.getTarget().getLocation().hasLocationInfo(targetFile, targetLine, _, _, _) and
|
||||
targetLine > gotoLine and
|
||||
// We avoid `=` for equality here since that might tempt the join orderer
|
||||
// into joining on the file name too early.
|
||||
gotoFile >= targetFile and
|
||||
gotoFile <= targetFile
|
||||
)
|
||||
goto.getLocation().isBefore(goto.getTarget().getLocation())
|
||||
}
|
||||
|
||||
cached IRVariable getInstructionVariable(Instruction instruction) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче