📄 labeldescriptor.java
字号:
// $Id: LabelDescriptor.java,v 1.2 1999/09/27 20:01:28 deberg Exp $package java6035.tools.IR;/** * LabelDescriptor * * represents a label in the low level IR tree, such as procedure and * block entry point. Calling the constructor will generate a unique * label with the given suffix. LabelDescriptor has a reference count * that can help to determine the usage of a label. */public class LabelDescriptor extends Descriptor { private static int counter = 0; private LabelInstr lab; private int ref_count = 0; /** * Creates a low IR label with "_Lxxx" as prefix, where xxx is a * unique number throughout the program. * * @param suffix Suffix of the label. */ public LabelDescriptor(String suffix, LabelInstr lab) { super("_L"+getCounter()+suffix); this.lab = lab; this.ref_count = 0; } public void ref() { ref_count++; } public void unref() { ref_count--; } public int getRef() { return ref_count; } /** * Returns the instruction that defines this label. */ public LabelInstr getLabelInstr() { return this.lab; } /** * return a counter, increment the counter to get the next one. */ public static int getCounter() { counter++; return counter-1; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -