mirror of
https://github.com/github/codeql.git
synced 2026-04-20 14:34:04 +02:00
Shared: Use shared SuccessorType in shared Cfg and BasicBlock libs.
This commit is contained in:
@@ -301,13 +301,9 @@ private class BasicBlockAlias = BasicBlock;
|
||||
|
||||
private class EntryBasicBlockAlias = EntryBasicBlock;
|
||||
|
||||
private class SuccessorTypeAlias = SuccessorType;
|
||||
|
||||
module Cfg implements BB::CfgSig<Location> {
|
||||
class ControlFlowNode = CfgNode;
|
||||
|
||||
class SuccessorType = SuccessorTypeAlias;
|
||||
|
||||
class BasicBlock = BasicBlockAlias;
|
||||
|
||||
class EntryBasicBlock = EntryBasicBlockAlias;
|
||||
|
||||
@@ -46,19 +46,10 @@ private module CfgInput implements CfgShared::InputSig<Location> {
|
||||
scope.(Impl::CfgScopeImpl).exit(last, c)
|
||||
}
|
||||
|
||||
class SuccessorType = Cfg::SuccessorType;
|
||||
private class SuccessorType = Cfg::SuccessorType;
|
||||
|
||||
SuccessorType getAMatchingSuccessorType(Completion c) { result = c.getAMatchingSuccessorType() }
|
||||
|
||||
predicate successorTypeIsSimple(SuccessorType t) { t instanceof Cfg::DirectSuccessor }
|
||||
|
||||
predicate successorTypeIsCondition(SuccessorType t) { t instanceof Cfg::ConditionalSuccessor }
|
||||
|
||||
predicate isAbnormalExitType(SuccessorType t) {
|
||||
t instanceof Cfg::ExceptionSuccessor or
|
||||
t instanceof Cfg::ExitSuccessor
|
||||
}
|
||||
|
||||
private predicate id(Ruby::AstNode node1, Ruby::AstNode node2) { node1 = node2 }
|
||||
|
||||
private predicate idOf(Ruby::AstNode node, int id) = equivalenceRelation(id/2)(node, id)
|
||||
|
||||
Reference in New Issue
Block a user