Skip to content

Commit 79bb39d

Browse files
committed
C#: Remove SSA location overrides.
1 parent 896e377 commit 79bb39d

1 file changed

Lines changed: 0 additions & 39 deletions

File tree

  • csharp/ql/lib/semmle/code/csharp/dataflow

csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,6 @@ module Ssa {
432432
deprecated final predicate isLiveOutRefParameterDefinition(Parameter p) {
433433
SsaImpl::isLiveOutRefParameterDefinition(this, p)
434434
}
435-
436-
/** Gets the location of this SSA definition. */
437-
override Location getLocation() { none() }
438435
}
439436

440437
/**
@@ -519,8 +516,6 @@ module Ssa {
519516
override Element getElement() { result = ad.getElement() }
520517

521518
override string toString() { result = "SSA def(" + this.getSourceVariable() + ")" }
522-
523-
override Location getLocation() { result = ad.getLocation() }
524519
}
525520

526521
/**
@@ -566,18 +561,6 @@ module Ssa {
566561
then result = "SSA capture def(" + this.getSourceVariable() + ")"
567562
else result = "SSA entry def(" + this.getSourceVariable() + ")"
568563
}
569-
570-
override Location getLocation() { result = this.getCallable().getLocation() }
571-
}
572-
573-
private module NearestLocationInput implements NearestLocationInputSig {
574-
class C = ImplicitParameterDefinition;
575-
576-
predicate relevantLocations(ImplicitParameterDefinition def, Location l1, Location l2) {
577-
not def.getBasicBlock() instanceof EntryBasicBlock and
578-
l1 = def.getParameter().getALocation() and
579-
l2 = def.getBasicBlock().getLocation()
580-
}
581564
}
582565

583566
pragma[nomagic]
@@ -608,14 +591,6 @@ module Ssa {
608591
override string toString() {
609592
result = "SSA param(" + pragma[only_bind_out](this.getParameter()) + ")"
610593
}
611-
612-
override Location getLocation() {
613-
not NearestLocation<NearestLocationInput>::nearestLocation(this, _, _) and
614-
result = p.getLocation()
615-
or
616-
// multi-bodied method: use matching parameter location
617-
NearestLocation<NearestLocationInput>::nearestLocation(this, result, _)
618-
}
619594
}
620595

621596
/**
@@ -649,8 +624,6 @@ module Ssa {
649624
}
650625

651626
override string toString() { result = "SSA call def(" + this.getSourceVariable() + ")" }
652-
653-
override Location getLocation() { result = this.getCall().getLocation() }
654627
}
655628

656629
/**
@@ -673,8 +646,6 @@ module Ssa {
673646
final Definition getQualifierDefinition() { result = q }
674647

675648
override string toString() { result = "SSA qualifier def(" + this.getSourceVariable() + ")" }
676-
677-
override Location getLocation() { result = this.getQualifierDefinition().getLocation() }
678649
}
679650

680651
/**
@@ -713,16 +684,6 @@ module Ssa {
713684
}
714685

715686
override string toString() { result = "SSA phi(" + this.getSourceVariable() + ")" }
716-
717-
/*
718-
* The location of a phi node is the same as the location of the first node
719-
* in the basic block in which it is defined.
720-
*
721-
* Strictly speaking, the node is *before* the first node, but such a location
722-
* does not exist in the source program.
723-
*/
724-
725-
override Location getLocation() { result = this.getBasicBlock().getFirstNode().getLocation() }
726687
}
727688

728689
/**

0 commit comments

Comments
 (0)