C++: Make ControlFlowNode's predicates concrete

The presence of abstract predicates on this class made it hard to
specialize it, and this is one of the reasons why the raw db-type
`@cfgnode` is often used in preference to `ControlFlowNode`.
This commit is contained in:
Jonas Jensen
2018-08-24 22:03:59 +02:00
parent ea9bff00c0
commit 1ed4a489ec

View File

@@ -34,10 +34,14 @@ class ControlFlowNode extends Locatable, @cfgnode {
ControlFlowNode getAPredecessor() { this = result.getASuccessor() }
/** Gets the function containing this control-flow node. */
abstract Function getControlFlowScope();
Function getControlFlowScope() {
none() // overridden in subclasses
}
/** Gets the smallest statement containing this control-flow node. */
abstract Stmt getEnclosingStmt();
Stmt getEnclosingStmt() {
none() // overridden in subclasses
}
/**
* Holds if this node is the top-level expression of a conditional statement,