C++: Remove a DefinitionExt reference.

This commit is contained in:
Anders Schack-Mulligen
2025-02-27 15:20:25 +01:00
parent 0c17786ed0
commit c5755ba8d4
2 changed files with 23 additions and 3 deletions

View File

@@ -1371,7 +1371,7 @@ class UninitializedNode extends Node {
LocalVariable v;
UninitializedNode() {
exists(Ssa::DefinitionExt def, Ssa::SourceVariable sv |
exists(Ssa::Definition def, Ssa::SourceVariable sv |
def.getIndirectionIndex() = 0 and
def.getValue().asInstruction() instanceof UninitializedInstruction and
Ssa::defToNode(this, def, sv, _, _, _) and

View File

@@ -698,9 +698,9 @@ predicate outNodeHasAddressAndIndex(
* Holds if `node` is the node that corresponds to the definition of `def`.
*/
predicate defToNode(
Node node, DefinitionExt def, SourceVariable sv, IRBlock bb, int i, boolean uncertain
Node node, Definition def, SourceVariable sv, IRBlock bb, int i, boolean uncertain
) {
def.definesAt(sv, bb, i, _) and
def.definesAt(sv, bb, i) and
(
nodeHasOperand(node, def.getValue().asOperand(), def.getIndirectionIndex())
or
@@ -1132,6 +1132,26 @@ class PhiNode extends SsaImpl::DefinitionExt {
final DefinitionExt getAnInput() { this.hasInputFromBlock(result, _, _, _, _) }
}
/** An static single assignment (SSA) definition. */
class Definition extends SsaImpl::Definition {
/**
* INTERNAL: Do not use.
*/
Node0Impl getValue() { result = getDefImpl(this).getValue() }
/** Gets the indirection index of this definition. */
int getIndirectionIndex() { result = getDefImpl(this).getIndirectionIndex() }
/** Gets the indirection of this definition. */
int getIndirection() { result = getDefImpl(this).getIndirection() }
/**
* Holds if this definition is guaranteed to totally overwrite the buffer
* being written to.
*/
predicate isCertain() { getDefImpl(this).isCertain() }
}
/** An static single assignment (SSA) definition. */
class DefinitionExt extends SsaImpl::DefinitionExt {
private DefinitionExt getAPhiInputOrPriorDefinition() { result = this.(PhiNode).getAnInput() }