Merge ControlFlowTreeBase and AstNode

This commit is contained in:
Tom Hvitved
2023-08-03 10:59:26 +02:00
parent 525ed65b0b
commit 2ac646770e
2 changed files with 5 additions and 12 deletions

View File

@@ -7,8 +7,8 @@ private import codeql.util.Location
/** Provides the language-specific input specification. */
signature module InputSig<LocationSig Location> {
/** The base class for `ControlFlowTree`. */
class ControlFlowTreeBase {
/** An AST node. */
class AstNode {
/** Gets a textual representation of this element. */
string toString();
@@ -16,9 +16,6 @@ signature module InputSig<LocationSig Location> {
Location getLocation();
}
/** An AST node. */
class AstNode extends ControlFlowTreeBase;
/** A control-flow completion. */
class Completion {
/** Gets a textual representation of this completion. */
@@ -127,10 +124,10 @@ signature module InputSig<LocationSig Location> {
module Make<LocationSig Location, InputSig<Location> Input> {
private import Input
final private class ControlFlowTreeBaseFinal = ControlFlowTreeBase;
final private class AstNodeFinal = AstNode;
/** An element with associated control flow. */
abstract class ControlFlowTree extends ControlFlowTreeBaseFinal {
abstract class ControlFlowTree extends AstNodeFinal {
/** Holds if `first` is the first element executed within this element. */
pragma[nomagic]
abstract predicate first(AstNode first);
@@ -809,8 +806,6 @@ module Make<LocationSig Location, InputSig<Location> Input> {
private predicate splitsBlockContains(AstNode start, AstNode n) =
fastTC(intraSplitsSucc/2)(start, n)
final private class AstNodeFinal = AstNode;
/**
* A block of control flow elements where the set of splits is guaranteed
* to remain unchanged, represented by the first element in the block.