harpoon.IR.Assem
Class InstrLABEL

java.lang.Object
  extended by harpoon.IR.Assem.Instr
      extended by harpoon.IR.Assem.InstrLABEL
All Implemented Interfaces:
HCodeElement, CFGraphable<Instr,InstrEdge>, UseDefable, Graph.Node<Instr,InstrEdge>

public class InstrLABEL
extends Instr

InstrLABEL is used to represents code labels in assembly-level instruction representations.

Version:
$Id: InstrLABEL.java,v 1.6 2004/02/08 01:55:08 cananian Exp $
Author:
Andrew Berkheimer <andyb@mit.edu>

Field Summary
 
Fields inherited from class harpoon.IR.Assem.Instr
arrayFactory, canFallThrough, next, prev
 
Constructor Summary
InstrLABEL(InstrFactory inf, HCodeElement src, String a, Label l)
          Create a code label Instr.
 
Method Summary
 void accept(InstrVisitor v)
          Accept a visitor.
 Instr cloneMutateAssem(InstrFactory inf, String newAssem)
          Clones this, mutating the assembly string.
 Label getLabel()
          Return the code label specified in the constructor.
protected  boolean hasMultiplePredecessors()
          Returns true.
 boolean isLabel()
          Returns true if this is a label instruction that is meant to mark a location in the code segment, not actual executable code.
static InstrLABEL makeNoFall(InstrFactory inf, HCodeElement src, String a, Label l)
           
 List<InstrEdge> predC()
          Returns the control flow predecessors of this.
 Instr rename(InstrFactory inf, TempMap defMap, TempMap useMap)
          Create a new Instr identical to the receiver, but with all Temps renamed according to the given mappings.
 
Methods inherited from class harpoon.IR.Assem.Instr
cloneMutateAssem, def, defC, edgeC, edges, getAssem, getEntry, getExit, getFactory, getGroups, getID, getInstrFor, getLineNumber, getNext, getPrev, getSourceFile, getTargets, hashCode, hasModifiableTargets, insertAt, insertInstrsAt, isDirective, isDummy, isJump, isMove, isPred, isSucc, layout, map, map, map, pred, remove, rename, rename, replace, replaceInstrList, setGroup, succ, succC, toString, use, useC
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstrLABEL

public InstrLABEL(InstrFactory inf,
                  HCodeElement src,
                  String a,
                  Label l)
Create a code label Instr. The specified String a should be the assembly-language representation of the given Label l.

Method Detail

makeNoFall

public static InstrLABEL makeNoFall(InstrFactory inf,
                                    HCodeElement src,
                                    String a,
                                    Label l)

getLabel

public Label getLabel()
Return the code label specified in the constructor.


rename

public Instr rename(InstrFactory inf,
                    TempMap defMap,
                    TempMap useMap)
Description copied from class: Instr
Create a new Instr identical to the receiver, but with all Temps renamed according to the given mappings. The new Instr will have no edges, and will come from the specified InstrFactory. FSK: I don't think this "no edges" part of the specification holds anymore (it was written before we revised the control-flow representation in the Instrs...

Overrides:
rename in class Instr

cloneMutateAssem

public Instr cloneMutateAssem(InstrFactory inf,
                              String newAssem)
Description copied from class: Instr
Clones this, mutating the assembly string.
requires: newAssem != null
effects: Returns a new Instr object with the same compiler-visible high level properties as this (use/def, isMove, etc), but instead of having the assembly-string of this, it has newAssem as its assembly string. The generated instr will not have a a place in the instruction layout; it is the responsiblity of the caller to subsequently call Instr.replace to swap this and the returned Instr.

Overrides:
cloneMutateAssem in class Instr

accept

public void accept(InstrVisitor v)
Accept a visitor.

Overrides:
accept in class Instr

hasMultiplePredecessors

protected boolean hasMultiplePredecessors()
Returns true. Labels are designed to have multiple predecessors.

Overrides:
hasMultiplePredecessors in class Instr

predC

public List<InstrEdge> predC()
Description copied from class: Instr
Returns the control flow predecessors of this. Note that this returns edges according to control flow, not in terms of instruction layout. Look at getNext() and getPrev() for information on instruction layout.

Specified by:
predC in interface CFGraphable<Instr,InstrEdge>
Specified by:
predC in interface Graph.Node<Instr,InstrEdge>
Overrides:
predC in class Instr

isLabel

public boolean isLabel()
Description copied from class: Instr
Returns true if this is a label instruction that is meant to mark a location in the code segment, not actual executable code.

Overrides:
isLabel in class Instr