All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.compiler.ir.operands.Variable Maven / Gradle / Ivy

There is a newer version: 9.4.7.0
Show newest version
package org.jruby.compiler.ir.operands;

import org.jruby.compiler.ir.representations.InlinerInfo;

import java.util.List;
import java.util.Map;

public abstract class Variable extends Operand implements Comparable {

    public abstract String getName();

    @Override
    public Operand getSimplifiedOperand(Map valueMap) {
        Operand v = valueMap.get(this);
        // You can only value-replace atomic values
        return ((v == null) || v.isNonAtomicValue()) ? this : v;
    }

    @Override
    public Operand getValue(Map valueMap) {
        Operand v = valueMap.get(this);

        return (v == null) ? this : v;
    }

    /** Append the list of variables used in this operand to the input list */
    @Override
    public void addUsedVariables(List l) {
        l.add(this);
    }

    @Override
    public Operand cloneForInlining(InlinerInfo ii) { 
        return ii.getRenamedVariable(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy