Skip to content

Commit

Permalink
C#: Remove remaining DefinitionExt references.
Browse files Browse the repository at this point in the history
  • Loading branch information
aschackmull committed Feb 27, 2025
1 parent 79069ce commit 1da3be4
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImpl.qll
Original file line number Diff line number Diff line change
Expand Up @@ -994,60 +994,6 @@ private module Cached {

import Cached

private string getSplitString(DefinitionExt def) {
exists(ControlFlow::BasicBlock bb, int i, ControlFlow::Node cfn |
def.definesAt(_, bb, i, _) and
result = cfn.(ControlFlow::Nodes::ElementNode).getSplitsString()
|
cfn = bb.getNode(i)
or
not exists(bb.getNode(i)) and
cfn = bb.getFirstNode()
)
}

string getToStringPrefix(DefinitionExt def) {
result = "[" + getSplitString(def) + "] "
or
not exists(getSplitString(def)) and
result = ""
}

/**
* An extended static single assignment (SSA) definition.
*
* This is either a normal SSA definition (`Definition`) or a
* phi-read node (`PhiReadNode`).
*
* Only intended for internal use.
*/
class DefinitionExt extends Impl::DefinitionExt {
override string toString() { result = this.(Ssa::Definition).toString() }

/** Gets the location of this definition. */
override Location getLocation() { result = this.(Ssa::Definition).getLocation() }

/** Gets the enclosing callable of this definition. */
Callable getEnclosingCallable() { result = this.(Ssa::Definition).getEnclosingCallable() }
}

/**
* A phi-read node.
*
* Only intended for internal use.
*/
class PhiReadNode extends DefinitionExt, Impl::PhiReadNode {
override string toString() {
result = getToStringPrefix(this) + "SSA phi read(" + this.getSourceVariable() + ")"
}

override Location getLocation() { result = this.getBasicBlock().getLocation() }

override Callable getEnclosingCallable() {
result = this.getSourceVariable().getEnclosingCallable()
}
}

private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInputSig {
private import csharp as Cs
private import semmle.code.csharp.controlflow.BasicBlocks
Expand Down

0 comments on commit 1da3be4

Please # to comment.