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

org.jruby.compiler.ir.compiler_pass.DominatorTreeBuilder Maven / Gradle / Ivy

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

import org.jruby.compiler.ir.IRScope;
import org.jruby.compiler.ir.IRExecutionScope;
import org.jruby.compiler.ir.IRMethod;
import org.jruby.compiler.ir.compiler_pass.CompilerPass;
import org.jruby.compiler.ir.representations.CFG;

public class DominatorTreeBuilder implements CompilerPass
{
    public DominatorTreeBuilder() { }

    public boolean isPreOrder() { return false; }

    public void run(IRScope s)
    {
        if (s instanceof IRExecutionScope) {
//            System.out.println("Starting build of dom tree for " + s);
            CFG c = ((IRExecutionScope)s).getCFG();
            try {
                c.buildDominatorTree();
            } catch (Exception e) {
                System.out.println("Caught exception building dom tree for " + c.getGraph());
                System.out.println("\nInstructions:\n" + c.toStringInstrs());
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy