bytecode: enhance symbol table with both slab and symbol name

This commit is contained in:
2023-11-21 23:27:21 -08:00
parent 6211ad4ff1
commit 76290a401a
9 changed files with 20 additions and 12 deletions

View File

@ -21,7 +21,7 @@ class CompileCommand : CliktCommand(help = "Compile Pork to Bytecode", name = "c
val compiledWorld = compiler.compile(compiledMain)
for (symbol in compiledWorld.symbolTable.symbols) {
val code = compiledWorld.code.subList(symbol.offset.toInt(), (symbol.offset + symbol.size).toInt())
println(symbol.id)
println(symbol.commonSymbolIdentity)
for ((index, op) in code.withIndex()) {
var annotation = ""
val annotations = compiledWorld.annotations.filter { it.inst == (symbol.offset + index.toUInt()) }

View File

@ -20,7 +20,7 @@ class ScopeAnalysisCommand : CliktCommand(help = "Run Scope Analysis", name = "s
"symbol ${visibleScopeSymbol.scopeSymbol.symbol.id} " +
"type=${visibleScopeSymbol.scopeSymbol.definition.type.name} " +
"internal=${visibleScopeSymbol.isInternalSymbol} " +
"slab=${visibleScopeSymbol.scopeSymbol.slabScope.slab.location.commonFriendlyName}"
"slab=${visibleScopeSymbol.scopeSymbol.slabScope.slab.location.commonLocationIdentity}"
)
}
}