[hir] Introduce AliasSet type

Starting to get wonky typing out the entire type. This typedef is better for 
typing and readability.
This commit is contained in:
Sathya Gunasekaran
2022-12-05 22:27:01 +00:00
parent 2dab6f6c4d
commit a855e76494
+2 -1
View File
@@ -13,6 +13,7 @@ type AbstractPrimitive = {
value: number | boolean | string | null | undefined;
};
export type AliasSet = Set<Identifier>;
class AbstractState {
aliases = new DisjointSet<Identifier>();
#values = new Map<Identifier, AbstractValue>();
@@ -135,7 +136,7 @@ class AbstractState {
}
}
export function buildAliasSets(func: HIRFunction): Array<Set<Identifier>> {
export function buildAliasSets(func: HIRFunction): Array<AliasSet> {
const state = new AbstractState();
for (const [_, block] of func.body.blocks) {
for (const instr of block.instructions) {