Merge remote-tracking branch 'origin/GP-2140-dragonmacher-delete-refs-action--SQUASHED'

This commit is contained in:
Ryan Kurtz 2025-06-16 13:50:29 -04:00
commit 592242fdba
35 changed files with 1032 additions and 278 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -36,17 +36,17 @@ public interface Reference extends Comparable<Reference> {
public static final int OTHER = -2;
/**
* Get the address of the codeunit that is making the reference.
* {@return Get the address of the code unit that is making the reference.}
*/
public Address getFromAddress();
/**
* Get the "to" address for this reference.
* {@return Get the "to" address for this reference.}
*/
public Address getToAddress();
/**
* Return whether this reference is marked as primary.
* {@return Return whether this reference is marked as primary.}
*/
public boolean isPrimary();
@ -59,7 +59,7 @@ public interface Reference extends Comparable<Reference> {
public long getSymbolID();
/**
* Get the type of reference being made.
* {@return Get the type of reference being made.}
*/
public RefType getReferenceType();
@ -71,50 +71,50 @@ public interface Reference extends Comparable<Reference> {
public int getOperandIndex();
/**
* Return true if this reference is on the Mnemonic and not on an operand
* {@return Return true if this reference is on the Mnemonic and not on an operand.}
*/
public boolean isMnemonicReference();
/**
* Return true if this reference is on an operand and not on the Mnemonic.
* {@return Return true if this reference is on an operand and not on the Mnemonic.}
*/
public boolean isOperandReference();
/**
* Returns true if this reference is an instance of StackReference and
* refers to a stack location.
* {@return Returns true if this reference is an instance of StackReference and
* refers to a stack location.}
*/
public boolean isStackReference();
/**
* Returns true if this reference is an instance of ExternalReference.
* {@return Returns true if this reference is an instance of ExternalReference.}
*/
public boolean isExternalReference();
/**
* Returns true if this reference is an instance of EntryReference.
* {@return Returns true if this reference is an instance of EntryReference.}
*/
public boolean isEntryPointReference();
/**
* Returns true if this reference to an address in the programs memory
* space. This includes offset and shifted references.
* {@return Returns true if this reference to an address in the programs memory
* space. This includes offset and shifted references.}
*/
public boolean isMemoryReference();
/**
* Returns true if this reference to an address in the programs register
* space.
* {@return Returns true if this reference to an address in the programs register
* space.}
*/
public boolean isRegisterReference();
/**
* Returns true if this reference is an instance of OffsetReference.
* {@return Returns true if this reference is an instance of OffsetReference.}
*/
public boolean isOffsetReference();
/**
* Returns true if this reference is an instance of ShiftedReference.
* {@return Returns true if this reference is an instance of ShiftedReference.}
*/
public boolean isShiftedReference();

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -72,7 +72,7 @@ public interface ReferenceManager {
* an operand will be made primary by default. All non-memory references
* will be removed from the specified operand. Certain reference {@link RefType types}
* may not be specified (e.g., {@link RefType#FALL_THROUGH}).
* @param fromAddr address of the codeunit where the reference occurs
* @param fromAddr address of the code unit where the reference occurs
* @param toAddr address of the location being referenced.
* Memory, stack, and register addresses are all permitted.
* @param type reference type - how the location is being referenced.
@ -189,7 +189,7 @@ public interface ReferenceManager {
* @param source the source of this reference
* @param type reference type - how the location is being referenced
* @return external reference
* @throws InvalidInputException
* @throws InvalidInputException if the input is invalid
*/
public Reference addExternalReference(Address fromAddr, int opIndex, ExternalLocation location,
SourceType source, RefType type) throws InvalidInputException;
@ -204,7 +204,7 @@ public interface ReferenceManager {
/**
* Remove all stack, external, and memory references for the given
* from address.
* @param fromAddr the address of the codeunit from which to remove all references.
* @param fromAddr the address of the code unit from which to remove all references.
*/
public void removeAllReferencesFrom(Address fromAddr);
@ -247,7 +247,7 @@ public interface ReferenceManager {
/**
* Get all flow references from the given address.
* @param addr the address of the codeunit to get all flows from.
* @param addr the address of the code unit to get all flows from.
* @return get all flow references from the given address.
*
*/
@ -279,7 +279,7 @@ public interface ReferenceManager {
/**
* Get the reference that has the given from and to address, and
* operand index.
* @param fromAddr the address of the codeunit making the reference.
* @param fromAddr the address of the code unit making the reference.
* @param toAddr the address being referred to.
* @param opIndex the operand index.
* @return reference which satisfies the specified criteria or null
@ -306,7 +306,7 @@ public interface ReferenceManager {
* address/opIndex. Keep in mind this is a rather inefficient
* method as it must examine all references from the specified
* fromAddr.
* @param fromAddr the address of the codeunit being tested
* @param fromAddr the address of the code unit being tested
* @param opIndex the index of the operand being tested.
* @return true if one or more reference from the specified address
* and opindex are defined, else false
@ -316,7 +316,7 @@ public interface ReferenceManager {
/**
* Returns true if there are any memory references at the given
* address.
* @param fromAddr the address of the codeunit being tested
* @param fromAddr the address of the code unit being tested
* @return true if one or more reference from the specified address
* are defined, else false
*/
@ -378,18 +378,20 @@ public interface ReferenceManager {
/**
* Returns the number of references from the specified <code>fromAddr</code>.
* @param fromAddr the address of the codeunit making the reference.
* @param fromAddr the address of the code unit making the reference.
* @return the number of references from the specified <code>fromAddr</code>.
*/
public int getReferenceCountFrom(Address fromAddr);
/**
* Return the number of references for "to" addresses.
* @return the number of references for "to" addresses.
*/
public int getReferenceDestinationCount();
/**
* Return the number of references for "from" addresses.
* @return the number of references for "from" addresses.
*/
public int getReferenceSourceCount();
@ -401,7 +403,7 @@ public interface ReferenceManager {
public boolean hasReferencesTo(Address toAddr);
/**
* Uodate the reference type on a memory reference.
* Update the reference type on a memory reference.
* @param ref reference to be updated
* @param refType new reference type
* @return updated reference