|
|
@ -39,7 +39,7 @@ public class LocalInfo { |
|
|
|
private static int serialnr = 0; |
|
|
|
private static int serialnr = 0; |
|
|
|
private static int nextAnonymousSlot = -1; |
|
|
|
private static int nextAnonymousSlot = -1; |
|
|
|
private int slot; |
|
|
|
private int slot; |
|
|
|
private boolean nameIsGenerated; |
|
|
|
private boolean nameIsGenerated = false; |
|
|
|
private boolean isUnique; |
|
|
|
private boolean isUnique; |
|
|
|
private String name; |
|
|
|
private String name; |
|
|
|
private Type type; |
|
|
|
private Type type; |
|
|
@ -93,6 +93,8 @@ public class LocalInfo { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (this != li) { |
|
|
|
if (this != li) { |
|
|
|
shadow = li; |
|
|
|
shadow = li; |
|
|
|
|
|
|
|
if (!nameIsGenerated) |
|
|
|
|
|
|
|
shadow.name = li.name; |
|
|
|
// GlobalOptions.err.println("combining "+name+"("+type+") and "
|
|
|
|
// GlobalOptions.err.println("combining "+name+"("+type+") and "
|
|
|
|
// +li.name+"("+li.type+")");
|
|
|
|
// +li.name+"("+li.type+")");
|
|
|
|
li.setType(type); |
|
|
|
li.setType(type); |
|
|
@ -149,23 +151,20 @@ public class LocalInfo { |
|
|
|
return getLocalInfo().name != null; |
|
|
|
return getLocalInfo().name != null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
public String guessName() { |
|
|
|
* Get the name of this local. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public String getName() { |
|
|
|
|
|
|
|
if (shadow != null) { |
|
|
|
if (shadow != null) { |
|
|
|
while (shadow.shadow != null) { |
|
|
|
while (shadow.shadow != null) { |
|
|
|
shadow = shadow.shadow; |
|
|
|
shadow = shadow.shadow; |
|
|
|
} |
|
|
|
} |
|
|
|
return shadow.getName(); |
|
|
|
return shadow.guessName(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (name == null) { |
|
|
|
if (name == null) { |
|
|
|
Enumeration enum = hints.elements(); |
|
|
|
Enumeration enum = hints.elements(); |
|
|
|
while (enum.hasMoreElements()) { |
|
|
|
while (enum.hasMoreElements()) { |
|
|
|
LocalVarEntry entry = (LocalVarEntry) enum.nextElement(); |
|
|
|
LocalVarEntry entry = (LocalVarEntry) enum.nextElement(); |
|
|
|
if (type.isOfType(entry.getType())) { |
|
|
|
if (type.isOfType(entry.getType())) { |
|
|
|
name = entry.getName(); |
|
|
|
name = entry.getName(); |
|
|
|
type = entry.getType(); |
|
|
|
setType(entry.getType()); |
|
|
|
return name; |
|
|
|
return name; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -177,7 +176,23 @@ public class LocalInfo { |
|
|
|
+ (slot >= 0 ? "_" + slot : "") + "_" + serialnr++ + "_"; |
|
|
|
+ (slot >= 0 ? "_" + slot : "") + "_" + serialnr++ + "_"; |
|
|
|
isUnique = true; |
|
|
|
isUnique = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return name; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Get the name of this local. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public String getName() { |
|
|
|
|
|
|
|
if (shadow != null) { |
|
|
|
|
|
|
|
while (shadow.shadow != null) { |
|
|
|
|
|
|
|
shadow = shadow.shadow; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return shadow.getName(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (name == null) { |
|
|
|
|
|
|
|
return "local_" + slot + "_"+ Integer.toHexString(hashCode()); |
|
|
|
|
|
|
|
} |
|
|
|
return name; |
|
|
|
return name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|