DerivedInductionVariable.java revision 12657:6ef01bd40ce2
1130561Sobrien/*
2218822Sdim * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
378828Sobrien * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
433965Sjdp *
533965Sjdp * This code is free software; you can redistribute it and/or modify it
633965Sjdp * under the terms of the GNU General Public License version 2 only, as
733965Sjdp * published by the Free Software Foundation.
833965Sjdp *
933965Sjdp * This code is distributed in the hope that it will be useful, but WITHOUT
1033965Sjdp * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1133965Sjdp * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1233965Sjdp * version 2 for more details (a copy is included in the LICENSE file that
1333965Sjdp * accompanied this code).
1433965Sjdp *
1533965Sjdp * You should have received a copy of the GNU General Public License version
1633965Sjdp * 2 along with this work; if not, write to the Free Software Foundation,
1733965Sjdp * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1833965Sjdp *
1933965Sjdp * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2033965Sjdp * or visit www.oracle.com if you need additional information or have any
2133965Sjdp * questions.
22218822Sdim */
23218822Sdimpackage org.graalvm.compiler.loop;
2433965Sjdp
2533965Sjdpimport org.graalvm.compiler.nodes.StructuredGraph;
2633965Sjdp
2733965Sjdp/**
2833965Sjdp * Base class of the derived induction variables.
2977298Sobrien */
3060484Sobrienpublic abstract class DerivedInductionVariable extends InductionVariable {
3160484Sobrien
3260484Sobrien    protected final InductionVariable base;
3360484Sobrien
3460484Sobrien    public DerivedInductionVariable(LoopEx loop, InductionVariable base) {
35130561Sobrien        super(loop);
3660484Sobrien        this.base = base;
37130561Sobrien    }
3860484Sobrien
3977298Sobrien    @Override
40130561Sobrien    public StructuredGraph graph() {
41130561Sobrien        return base.graph();
42130561Sobrien    }
43130561Sobrien
44130561Sobrien    public InductionVariable getBase() {
45218822Sdim        return base;
46218822Sdim    }
47218822Sdim}
48218822Sdim