All Superinterfaces:
Comparable<IVariable>, IEGeneric, IInstructionOperand, ISegment<Integer>, IVariable

@Ser public interface IEVar extends IEGeneric, IVariable
Representation of an IR variable. Also a polymorphic placeholder for a variety of terminal expressions.

Variables can represent underlying physical registers, virtual registers, local variables, global variables, etc. The class of an IEVar can be retrieved from its id. Global-scope (IEGlobalContext) ids are positive or zero; local-scope (IERoutineContext) ids are negative.

  • Field Details

    • FLAG_NO_COPY

      static final int FLAG_NO_COPY
      This variable should not be copied: duplicates, pairs, splits generally created during SSA- or SSA-like passes are forbidden. The original var should be used (and therefore, types are unlikely to be applied to it.)
      See Also:
    • FLAG_LIKELY_SAVED_VAR

      static final int FLAG_LIKELY_SAVED_VAR
      Variables with this flag are stack variables likely to be defensive copies of registers that need to be preserved.

      Such variables should not be treated as local vars when it comes to may-use/may-def calculations for statements that access memory, such as EMem or ECall. That yields cleaner conservative data chains.

      See Also:
    • FLAG_LIKELY_COPIED_PARAM

      static final int FLAG_LIKELY_COPIED_PARAM
      Variables with this flag are stack variables likely to be copies of input parameters, that may have been provided in physical registers.

      SUch variables should not be treated as local vars when it comes to may-use/may-def calculations for statements that access memory, such as EMem or ECall. That yields cleaner conservative data chains.

      See Also:
    • ID_BEGIN

      static final int ID_BEGIN
      See Also:
    • ID_END

      static final int ID_END
      See Also:
    • ID_PHYSICAL_REGISTER

      static final int ID_PHYSICAL_REGISTER
      See Also:
    • ID_PHYSICAL_REGISTER_END

      static final int ID_PHYSICAL_REGISTER_END
      See Also:
    • ID_VIRTUAL_REGISTER

      static final int ID_VIRTUAL_REGISTER
      See Also:
    • ID_VIRTUAL_REGISTER_END

      static final int ID_VIRTUAL_REGISTER_END
      See Also:
    • ID_REGISTER

      static final int ID_REGISTER
      See Also:
    • ID_REGISTER_END

      static final int ID_REGISTER_END
      See Also:
    • REGISTER_RANGE_SIZE

      static final int REGISTER_RANGE_SIZE
      See Also:
    • ID_SYMBOL

      static final int ID_SYMBOL
      See Also:
    • ID_SYMBOL_END

      static final int ID_SYMBOL_END
      See Also:
    • ID_MEMVAR

      static final int ID_MEMVAR
      See Also:
    • ID_MEMVAR_END

      static final int ID_MEMVAR_END
      See Also:
    • ID_PSEUDO_VAR

      static final int ID_PSEUDO_VAR
      See Also:
    • IDL_PSEUDO_VAR

      static final int IDL_PSEUDO_VAR
      See Also:
    • IDL_PSEUDO_VAR_END

      static final int IDL_PSEUDO_VAR_END
      See Also:
    • IDL_SPECIAL

      static final int IDL_SPECIAL
      See Also:
    • IDL_SPECIAL_END

      static final int IDL_SPECIAL_END
      See Also:
    • IDL_MIRROR

      static final int IDL_MIRROR
      SOR for primary duplicates (primary dup. = "mirror") of IEVar-registers. Note that the range must have same size as the full register range.
      See Also:
    • IDL_MIRROR_END

      static final int IDL_MIRROR_END
      EOR for primary duplicates (primary dup. = "mirror") of IEVar-registers. Note that the range must have same size as the full register range.
      See Also:
    • IDL_COPY_DUP2

      static final int IDL_COPY_DUP2
      SOR for additional (secondary) duplicates of IEVar-registers.
      See Also:
    • IDL_COPY_DUP2_END

      static final int IDL_COPY_DUP2_END
      EOR for additional (secondary) duplicates of IEVar-registers.
      See Also:
    • IDL_COPY_MERGER

      static final int IDL_COPY_MERGER
      SOR for copies that consist of mergers of 2 or more IEVar-registers.
      See Also:
    • IDL_COPY_MERGER_END

      static final int IDL_COPY_MERGER_END
      EOR for copies that consist of mergers of 2 or more IEVar-registers.
      See Also:
    • IDL_COPY_SLICE

      static final int IDL_COPY_SLICE
      SOR for partial (truncated, slices) copies of IEVar-registers.
      See Also:
    • IDL_COPY_SLICE_END

      static final int IDL_COPY_SLICE_END
      EOR for partial (truncated, slices) copies of IEVar-registers.
      See Also:
    • IDL_COPY_DUPFULL

      static final int IDL_COPY_DUPFULL
      SOR for duplicates (mirrors and secondary duplicates).
      See Also:
    • IDL_COPY_DUPFULL_END

      static final int IDL_COPY_DUPFULL_END
      EOR for duplicates (mirrors and secondary duplicates).
      See Also:
    • IDL_COPY

      static final int IDL_COPY
      Start of full range for copy variables. The full range consists of: duplicates (mirrors + secondary duplicates), mergers, and slices.
      See Also:
    • IDL_COPY_END

      static final int IDL_COPY_END
      End of full range for copy variables. The full range consists of: duplicates (mirrors + secondary duplicates), mergers, and slices.
      See Also:
    • IDL_SYMBOL

      static final int IDL_SYMBOL
      Start of range for stack-variable references.
      See Also:
    • IDL_SYMBOL_END

      static final int IDL_SYMBOL_END
      End of range for stack-variable references.
      See Also:
    • IDL_VIRTUAL

      static final int IDL_VIRTUAL
      See Also:
    • IDL_VIRTUAL_END

      static final int IDL_VIRTUAL_END
      See Also:
    • IDL_STACKVAR

      static final int IDL_STACKVAR
      See Also:
    • IDL_STACKVAR_BASE

      static final int IDL_STACKVAR_BASE
      See Also:
    • IDL_STACKVAR_END

      static final int IDL_STACKVAR_END
      See Also:
    • IDL_BEGIN

      static final int IDL_BEGIN
      See Also:
    • IDL_END

      static final int IDL_END
      See Also:
  • Method Details

    • isTypeable

      boolean isTypeable()
      Returns:
    • copyProperties

      void copyProperties(IEVar dst)
      Parameters:
      dst -
    • generateC

      ICElement generateC(IERoutineContext ectx, ICMethod cctx, int position)
      Specialized C Variable generator, allowing the specification of the variable position within its containing expression.
      Parameters:
      ectx -
      cctx -
      position - variable "position": 0=unknown, 1=left-side of EAssign, 2=function parameter
      Returns:
    • generateC

      ICElement generateC(IERoutineContext ectx, ICMethod cctx, int position, boolean deref)
      Specialized C Variable generator, allowing the specification of the variable position within its containing expression.
      Parameters:
      ectx -
      cctx -
      position - variable "position": 0=unknown, 1=left-side of EAssign, 2=function parameter
      deref - generate a dereferenced version of the variable
      Returns:
    • getId

      int getId()
      Specified by:
      getId in interface IVariable
    • getName

      String getName()
      Specified by:
      getName in interface IVariable
    • getAddress

      Long getAddress()
    • isPhysicalRegister

      default boolean isPhysicalRegister()
    • isVirtualRegister

      default boolean isVirtualRegister()
    • isRegister

      default boolean isRegister()
    • isGlobalVariable

      default boolean isGlobalVariable()
    • isGlobalReference

      default boolean isGlobalReference()
    • isRoutineScope

      default boolean isRoutineScope()
    • isPseudoVar

      default boolean isPseudoVar()
    • isCopy

      default boolean isCopy()
    • isStackVariable

      default boolean isStackVariable()
    • isStackReference

      default boolean isStackReference()
    • isReference

      default boolean isReference()