Fix game-of-life example inconsistencies; Fix ternary expression issues in void contexts and variable statements; Simplify HEAP_BASE handling

This commit is contained in:
dcodeIO
2018-04-18 15:12:33 +02:00
parent 4026c087fd
commit 5a2f834c0d
19 changed files with 654 additions and 559 deletions

View File

@ -47,25 +47,6 @@ import {
OperatorKind
} from "./program";
/** Compiles a get of a built-in global. */
export function compileGetConstant(
compiler: Compiler,
global: Global,
reportNode: Node
): ExpressionRef {
switch (global.internalName) {
case "HEAP_BASE": { // never inlined for linking purposes
compiler.currentType = compiler.options.usizeType;
return compiler.module.createGetGlobal("HEAP_BASE", compiler.currentType.toNativeType());
}
}
compiler.error(
DiagnosticCode.Operation_not_supported,
reportNode.range
);
return compiler.module.createUnreachable();
}
/** Compiles a call to a built-in function. */
export function compileCall(
compiler: Compiler,