lib/acpica/source/components/disassembler/dmcstyle.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDmIsTargetAnOperand
 *
 * PARAMETERS:  Target              - Target associated with the expression
 *              Operand             - An operand associated with expression
 *
 * RETURN:      TRUE if expression can be converted to a compound assignment.
 *              FALSE otherwise.
 *
 * DESCRIPTION: Determine if the Target duplicates the operand, in order to
 *              detect if the expression can be converted to a compound
 *              assigment. (+=, *=, etc.)
 *
 ******************************************************************************/
AcpiDmIsTargetAnOperand
PARAMETERS:  Target              - Target associated with the expression
Operand             - An operand associated with expression

TRUE if expression can be converted to a compound assignment.
FALSE otherwise.

Determine if the Target duplicates the operand, in order to
detect if the expression can be converted to a compound
assigment.
AcpiDmIsTargetAnOperand PARAMETERS : Target - Target associated with the expression Operand - An operand associated with expression TRUE if expression can be converted to a compound assignment . FALSE otherwise . Determine if the Target duplicates the operand in order to detect if the expression can be converted to a compound assigment .
static BOOLEAN
AcpiDmIsTargetAnOperand (
    ACPI_PARSE_OBJECT       *Target,
    ACPI_PARSE_OBJECT       *Operand,
    BOOLEAN                 TopLevel)
{
    const ACPI_OPCODE_INFO  *OpInfo;
    BOOLEAN                 Same;
    if (Target->Common.AmlOpcode != Operand->Common.AmlOpcode)
    {
        return (FALSE);
    }
    if (Target->Common.Node != Operand->Common.Node)
    {
        return (FALSE);
    }
    OpInfo = AcpiPsGetOpcodeInfo (Operand->Common.AmlOpcode);
    if (OpInfo->Flags & AML_HAS_ARGS)
    {
        Same = AcpiDmIsTargetAnOperand (Target->Common.Value.Arg,
            Operand->Common.Value.Arg, FALSE);
        if (!Same)
        {
            return (FALSE);
        }
    }
    if ((!TopLevel) &&
         Target->Common.Next)
    {
        Same = AcpiDmIsTargetAnOperand (Target->Common.Next,
            Operand->Common.Next, FALSE);
        if (!Same)
        {
            return (FALSE);
        }
    }
    if (TopLevel)
    {
        Operand->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
    }
    return (TRUE);
}
static BOOLEAN AcpiDmIsTargetAnOperand ( ACPI_PARSE_OBJECT * Target , ACPI_PARSE_OBJECT * Operand , BOOLEAN TopLevel ) { const ACPI_OPCODE_INFO * OpInfo ; BOOLEAN Same ; if ( Target -> Common . AmlOpcode != Operand -> Common . AmlOpcode ) { return ( FALSE ) ; } if ( Target -> Common . Node != Operand -> Common . Node ) { return ( FALSE ) ; } OpInfo = AcpiPsGetOpcodeInfo ( Operand -> Common . AmlOpcode ) ; if ( OpInfo -> Flags & AML_HAS_ARGS ) { Same = AcpiDmIsTargetAnOperand ( Target -> Common . Value . Arg , Operand -> Common . Value . Arg , FALSE ) ; if ( ! Same ) { return ( FALSE ) ; } } if ( ( ! TopLevel ) && Target -> Common . Next ) { Same = AcpiDmIsTargetAnOperand ( Target -> Common . Next , Operand -> Common . Next , FALSE ) ; if ( ! Same ) { return ( FALSE ) ; } } if ( TopLevel ) { Operand -> Common . DisasmFlags |= ACPI_PARSEOP_IGNORE ; } return ( TRUE ) ; }
FUNCTION:    AcpiDmIsTargetAnOperand
 PARAMETERS:  Target              - Target associated with the expression
              Operand             - An operand associated with expression
FUNCTION : AcpiDmIsTargetAnOperand PARAMETERS : Target - Target associated with the expression Operand - An operand associated with expression
/*
     * Opcodes must match. Note: ignoring the difference between nameseg
     * and namepath for now. May be needed later.
     */ /* Nodes should match, even if they are NULL */ /* Determine if a child exists */ /* Check the next peer, as long as we are not at the top level */ /* Supress the duplicate operand at the top-level */