Class OperationInstr

java.lang.Object
org.ek9lang.compiler.ir.instructions.OperationInstr
All Implemented Interfaces:
Comparable<OperationInstr>, INode

public final class OperationInstr extends Object implements INode, Comparable<OperationInstr>
An operation on some sort on a Construct. By this we are talking about methods and operators, but also constructors and 'init' operations.

For example in the case of normal classes/traits/components etc. this would just be a method.

In the case of a function it would also be a method but with a name of 'call' and the normal function signature would be applied (to the 'call' operation).

  • Constructor Details

  • Method Details

    • getBody

      public BasicBlockInstr getBody()
    • setBody

      public OperationInstr setBody(BasicBlockInstr basicBlockBody)
    • getSymbol

      public ISymbol getSymbol()
    • getResolvedMethodName

      public String getResolvedMethodName()
      The resolved, arity-aware backend method name for this operation — the name a back-end MUST emit for the DEFINITION, and never re-derive from the operator glyph. Mirrors CallDetails.methodName on the call side so both planes agree. In particular the arity-overloaded operator - resolves to _negate when arg-less (unary negate) and _sub when arg-bearing (binary subtract) — the IR carries the correct name so the back-ends stop deducing (and stop mis-deducing arg-less - as _sub). Computed lazily from the symbol so the method's parameter list is always fully populated by read time. Non-operator methods return their plain name.
      Returns:
      the resolved runtime method name for this operation
    • getDebugInfo

      public DebugInfo getDebugInfo()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • accept

      public void accept(INodeVisitor visitor)
      Specified by:
      accept in interface INode
    • compareTo

      public int compareTo(OperationInstr o)
      Specified by:
      compareTo in interface Comparable<OperationInstr>