001 /*
002 * This file is part of the Jikes RVM project (http://jikesrvm.org).
003 *
004 * This file is licensed to You under the Eclipse Public License (EPL);
005 * You may not use this file except in compliance with the License. You
006 * may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/eclipse-1.0.php
009 *
010 * See the COPYRIGHT.txt file distributed with this work for information
011 * regarding copyright ownership.
012 */
013 package org.jikesrvm.compilers.opt.ir.operand;
014
015
016 /**
017 * This operand represents, in a phi function, a control-flow path that is
018 * actually unreachable.
019 *
020 * @see Operand
021 */
022 public final class UnreachableOperand extends ConstantOperand {
023
024 /**
025 * Return a new operand that is semantically equivalent to <code>this</code>.
026 *
027 * @return a copy of <code>this</code>
028 */
029 public Operand copy() {
030 return new UnreachableOperand();
031 }
032
033 /**
034 * Are two operands semantically equivalent?
035 *
036 * @param op other operand
037 * @return <code>true</code> if <code>this</code> and <code>op</code>
038 * are semantically equivalent or <code>false</code>
039 * if they are not.
040 */
041 public boolean similar(Operand op) {
042 return op instanceof UnreachableOperand;
043 }
044
045 /**
046 * Returns the string representation of this operand.
047 *
048 * @return a string representation of this operand.
049 */
050 public String toString() {
051 return "<unreachable>";
052 }
053 }