summaryrefslogtreecommitdiff
path: root/src/codegen/Label.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/Label.java')
-rw-r--r--src/codegen/Label.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/codegen/Label.java b/src/codegen/Label.java
index f0a4c6e..a301ede 100644
--- a/src/codegen/Label.java
+++ b/src/codegen/Label.java
@@ -6,6 +6,7 @@ public class Label {
private static int labelCounter = 0;
private static int globalVarNum = 0;
private static int functionLabelCounter = 0;
+ private static int varDefCount = 0;
public static void addFunDef(String s) {
funDef += s;
@@ -38,4 +39,8 @@ public class Label {
return base + (functionLabelCounter++);
}
+
+ public static String newVar() {
+ return "_tmp" + (varDefCount++);
+ }
}