mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-09 00:14:10 -08:00
Wasm backend: write function index in AST representation to make easier navigation and debugging
This commit is contained in:
parent
c58e19405c
commit
dbe31c43bf
|
@ -57,14 +57,15 @@ public class WasmRenderer {
|
||||||
visitor.open().append("module");
|
visitor.open().append("module");
|
||||||
renderTypes(module);
|
renderTypes(module);
|
||||||
|
|
||||||
|
int functionIndex = 0;
|
||||||
for (WasmFunction function : module.getFunctions().values()) {
|
for (WasmFunction function : module.getFunctions().values()) {
|
||||||
if (function.getImportName() != null) {
|
if (function.getImportName() != null) {
|
||||||
lf().render(function);
|
lf().append(";; function #" + functionIndex++).lf().render(function);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (WasmFunction function : module.getFunctions().values()) {
|
for (WasmFunction function : module.getFunctions().values()) {
|
||||||
if (function.getImportName() == null) {
|
if (function.getImportName() == null) {
|
||||||
lf().render(function);
|
lf().append(";; function #" + functionIndex++).lf().render(function);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user