Skip to content

Commit 1dd1f12

Browse files
committed
Dataflow: Move Level1CallContext to DataFlowImplCommon
1 parent e1e6cd9 commit 1dd1f12

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,21 +2552,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
25522552
CcNoCall getCallContextReturn(DataFlowCallable c, DataFlowCall call) { any() }
25532553
}
25542554

2555-
private module Level1CallContext {
2556-
class Cc = CallContext;
2557-
2558-
class CcCall = CallContextCall;
2559-
2560-
pragma[inline]
2561-
predicate matchesCall(CcCall cc, DataFlowCall call) { cc.matchesCall(call) }
2562-
2563-
class CcNoCall = CallContextNoCall;
2564-
2565-
Cc ccNone() { result instanceof CallContextAny }
2566-
2567-
CcCall ccSomeCall() { result instanceof CallContextSomeCall }
2568-
}
2569-
25702555
private module Stage2Param implements MkStage<Stage1>::StageParam {
25712556
private module PrevStage = Stage1;
25722557

@@ -2605,7 +2590,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
26052590
ApOption apSome(Ap ap) { result = TBooleanSome(ap) }
26062591

26072592
import CachedCallContextSensitivity
2608-
import Level1CallContext
26092593
import NoLocalCallContext
26102594

26112595
bindingset[node1, state1]
@@ -2892,7 +2876,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
28922876
}
28932877

28942878
import CallContextSensitivity<CallContextSensitivityInput>
2895-
import Level1CallContext
28962879
import NoLocalCallContext
28972880

28982881
predicate localStep(
@@ -3280,7 +3263,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
32803263
}
32813264

32823265
import CallContextSensitivity<CallContextSensitivityInput>
3283-
import Level1CallContext
32843266
import LocalCallContext
32853267

32863268
predicate localStep(

shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,19 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
537537
* of the input predicates in `CachedCallContextSensitivity`.
538538
*/
539539
module PrunedViableImpl<PrunedViableImplInputSig Input2> {
540+
class Cc = CallContext;
541+
542+
class CcCall = CallContextCall;
543+
544+
pragma[inline]
545+
predicate matchesCall(CcCall cc, DataFlowCall call) { cc.matchesCall(call) }
546+
547+
class CcNoCall = CallContextNoCall;
548+
549+
Cc ccNone() { result instanceof CallContextAny }
550+
551+
CcCall ccSomeCall() { result instanceof CallContextSomeCall }
552+
540553
/**
541554
* Gets a viable run-time dispatch target for the call `call` in the
542555
* context `ctx`. This is restricted to those calls for which a context

0 commit comments

Comments
 (0)