return in try

This commit is contained in:
Jindra Petřík
2021-01-25 11:01:30 +01:00
parent f4e4835f29
commit ddd2d5697b
11 changed files with 162 additions and 17 deletions

View File

@@ -33,6 +33,16 @@ public class FinalProcessLocalData {
public final List<Loop> loops;
public Map<Integer, Set<Integer>> registerUsage;
public Set<Integer> getRegisterUsage(int regIndex) {
if (registerUsage == null) {
return new HashSet<>();
}
if (!registerUsage.containsKey(regIndex)) {
return new HashSet<>();
}
return registerUsage.get(regIndex);
}
public FinalProcessLocalData(List<Loop> loops) {
temporaryRegisters = new HashSet<>();
registerUsage = new HashMap<>();