@samitouri / QOS-React-2 / commits / a855e76494

[hir] Introduce AliasSet type

Starting to get wonky typing out the entire type. This typedef is better for typing and readability.

Sathya Gunasekaran committed Dec 5, 2022 at 22:27 UTC a855e764945ccc75f50c8c176528c77db13580ee
1 file changed +2 -1
compiler/forget/src/HIR/BuildAliasSets.ts
+2 -1
@@ -13,6 +13,7 @@ type AbstractPrimitive = {
13 value: number | boolean | string | null | undefined;
14 };
15
16 +export type AliasSet = Set<Identifier>;
17 class AbstractState {
18 aliases = new DisjointSet<Identifier>();
19 #values = new Map<Identifier, AbstractValue>();
@@ -135,7 +136,7 @@ class AbstractState {
136 }
137 }
138
138 -export function buildAliasSets(func: HIRFunction): Array<Set<Identifier>> {
139 +export function buildAliasSets(func: HIRFunction): Array<AliasSet> {
140 const state = new AbstractState();
141 for (const [_, block] of func.body.blocks) {
142 for (const instr of block.instructions) {