refactor crate loading

This commit is contained in:
nora 2023-08-02 14:32:42 +02:00
parent dd93453943
commit beb0321382
9 changed files with 131 additions and 99 deletions

View file

@ -2,6 +2,7 @@ import {
Crate,
Expr,
ExprBlock,
Final,
Folder,
FunctionDef,
GlobalItem,
@ -60,7 +61,7 @@ export type Context = {
reservedHeapMemoryStart: number;
funcIndices: ComplexMap<Resolution, FuncOrImport>;
globalIndices: ComplexMap<Resolution, wasm.GlobalIdx>;
crates: Crate<Typecked>[];
crates: Crate<Final>[];
relocations: Relocation[];
knownDefPaths: ComplexMap<string[], ItemId>;
};
@ -154,7 +155,7 @@ function getKnownDefPaths(
return knows;
}
export function lower(crates: Crate<Typecked>[]): wasm.Module {
export function lower(crates: Crate<Final>[]): wasm.Module {
const knownDefPaths = getKnownDefPaths(crates);
const mod: wasm.Module = {