mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 21:21:33 +00:00
rework some bits of the compiler to work more appropriately
This commit is contained in:
@ -46,7 +46,11 @@ class CompilableSymbol(val compilableSlab: CompilableSlab, val scopeSymbol: Scop
|
||||
}
|
||||
val type = if (what is NativeFunctionDescriptor) {
|
||||
IrDefinitionType.NativeFunction
|
||||
} else IrDefinitionType.CodeFunction
|
||||
} else if (scopeSymbol.definition is LetDefinition) {
|
||||
IrDefinitionType.Variable
|
||||
} else {
|
||||
IrDefinitionType.CodeFunction
|
||||
}
|
||||
val irCodeElement = irCodeEmitter.visit(what)
|
||||
val irCodeBlock = if (irCodeElement is IrCodeBlock) {
|
||||
irCodeElement
|
||||
|
@ -42,7 +42,9 @@ class Compiler(val world: World) {
|
||||
}
|
||||
}
|
||||
|
||||
fun compileIrWorld(): IrWorld {
|
||||
fun compileIrWorld(entryPointSymbol: CompilableSymbol): IrWorld {
|
||||
val usedSymbolSet = mutableSetOf<CompilableSymbol>()
|
||||
contributeCompiledSymbols(usedSymbolSet, entryPointSymbol.scopeSymbol, entryPointSymbol)
|
||||
val slabs = mutableListOf<IrSlab>()
|
||||
for (slab in world.slabs) {
|
||||
slabs.add(compilableSlabs.of(slab).compiledIrSlab)
|
||||
|
Reference in New Issue
Block a user