Skip to content

Commit 36860be

Browse files
committed
Java/Shared: Add caching to the CFG library.
1 parent 5f28b82 commit 36860be

File tree

2 files changed

+235
-189
lines changed

2 files changed

+235
-189
lines changed

java/ql/lib/semmle/code/java/ControlFlowGraph.qll

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,16 @@ private import codeql.controlflow.ControlFlowGraph
99
private import codeql.controlflow.SuccessorType
1010
private import controlflow.internal.Preconditions
1111

12-
private module ControlFlow0 = Make0<Location, Ast>;
12+
private module Cfg0 = Make0<Location, Ast>;
1313

14-
private module ControlFlow1 = Make1<Input>;
14+
private module Cfg1 = Make1<Input>;
1515

16-
private module ControlFlow2 = Make2<Input>;
16+
private module Cfg2 = Make2<Input>;
1717

18-
private import ControlFlow0
19-
private import ControlFlow1
20-
import ControlFlow2 as ControlFlow
21-
22-
class ControlFlowNode = ControlFlow::ControlFlowNode;
23-
24-
module Cfg = ControlFlow::Cfg;
25-
26-
import Cfg
18+
private import Cfg0
19+
private import Cfg1
20+
private import Cfg2
21+
import Public
2722

2823
/** Provides an implementation of the AST signature for Java. */
2924
module Ast implements AstSig<Location> {
@@ -434,6 +429,8 @@ private module NonReturningCalls {
434429
private module Input implements InputSig1, InputSig2 {
435430
private import java as J
436431

432+
predicate cfgCachedStageRef() { CfgCachedStage::ref() }
433+
437434
/** Holds if this catch clause catches all exceptions. */
438435
predicate catchAll(Ast::CatchClause catch) {
439436
catch.getACaughtType() instanceof TypeThrowable

0 commit comments

Comments
 (0)